Hello, so I have made a JFrame and put some JLabels in it.
I have two classes in the programm.
I have overriden the actionPerformed so I can set an action for my button. I want the button to add the oo label as soon as it is clicked but for some reason the label gets added after I click it the second time and not the first.
I wanted to know why is that so.
this is the class where I set the button and the label that I want to add as soon as it is clicked:
I'm a little rusty but when you change the look of something after setVisible(true) has been called then you have to invalidate it to get it to redraw. Sorry but I don't remember the exact method to call.