no, dont use static, and dont make it a member variable either. you just declare them is final within your method. The same method you have been using already.
This means that you can not use the...
Type: Posts; User: Cornix
no, dont use static, and dont make it a member variable either. you just declare them is final within your method. The same method you have been using already.
This means that you can not use the...
Make it known. If you dont want to make it a private member variable you can also declare it as "final".
Perhaps you should read up on anonymous classes.
Well, this was your question:
So the answer is pretty simple: Nothing happens because you never told the button what to do when it is being clicked.
As far as I know there are 2 ways to define...
And where do you tell the button that it is supposed to execute these lines?
No you dont.
This is "before the last 2 lines":
JButton button = new JButton("OK");
pane.add(button);
button.setBounds(120,120,40,20);
And you dont tell the button anything here. Just because...
At what point in your code do you tell the button what to do when it is clicked?