i make a JFrame window and i add a label i.e. myLabel , which has an image and down from the label a button i.e. dice. I want when i press the button to change the image on the label but when i am trying to compile i got an error on ActionListener.
In ActionListener i have something like this:
and got error : cannot find symbol variable myLabel
So what can i do in order to change the icon on the label?
Thanks!
In ActionListener i have something like this:
Code:
myLabel.setIcon= icon2;
So what can i do in order to change the icon on the label?
Thanks!
Comment