This is my first posting to javaranch, though I have been learning a lot over the past few weeks just from reading the responses to various questions--so thanks to everybody for asking and answering questions!
I'm working with the Head First
Java book. I've taken one of the code examples given there and have been slightly tweaking it (helps me learn stuff),and I've run into a problem that I think shows that I don't understand something fairly fundamental.
Here's the code. Basically, it just creates a panel, a text box within the panel, and a button to press. Originally, the code was such that when the button was pressed,the text box printed 'button clicked' for every time it was pressed. I thought I'd just see if I could change it a bit so that after 5 times of pressing, it would print 'Knock it off' and after 10 times it would print 'That's it, I quit' and then close the panel (or make it invisible).
It compiles just fine, and runs fine until I press the button 10 times, at which time it prints out "That's it, I quit!"...and then I get a series of exception errors:
Obviously there is an unknown source problem. Heh. I'm guessing my problem involves the code in bold.
My guess is that I'm doing something wrong regarding using 'frame', but I'm not sure what...and I'm still not the clearest on public/private variables just yet.
I'm almost certain that I'm missing something simple and basic (and therefore important) here, so I'd appreciate a nudge in the right direction.
I realize that this is a 'homework-ish' type problem, but it would help me to understand better in general, so thanks in advance.
ps--oh, and could somebody tell me if Java is a TRUE object-oriented language? Just kidding...