Glad we could help. :)

I would just like to add a suggestion for those who stumble upon this the way I did. I had the EXACT same error and even with this thread it took me forever to figure out (2 hours actually). I'm a new programmer (can't really even call me that yet) so forgive any mistakes.

So I had a JButton that I declared at the very top of my code (as instance variable i guess?) and then AGAIN i declared it WITHIN my constructor. Not sure if this is how to word it so I will put an example.

public class Hangman extends JFrame{

    private JButton a;  //created variable 'a' to refer to a future button.

    public Hangman(){
        JButton n = new JButton("n");  //then here I put "JButton" again, and aparently didn't need that? Because when I removed JButton from this line, everything went back to normal.

    //then down here I had another method that was used to set a few properties of n.

I also post this because I don't fully understand it and would like to know why it did this. I assume that it went out of scope or something, because the action handler that was controlling the 'a' button worked great, but the method called later to work on the properties was outside of the method it was created in. The button never left the frame, but aparently no longer existed in memory. Can someone explain this so I understand WHY it happend? I fixed my ...

blowhole commented: thanks, your probelm was my same exact problem. did you ever find out the reason it didn't work? +0

HAHAHAHAHAH! Thanks guys, you just made my morning. Sorry, I just couldn't help myself with that last post. I was in a good mood yesterday I guess. This would have been a great oportunity to mess with Stultuske a bit, but in the interest of not completely trolling a usefull and productive thread I will refrain ;) "Fact. Bears eat beets. Bears. Beets. Battlestar Galactica." lol.