How to Change a JLabel in a Frame when a Button is clicked?
I have a JFrame object that has as a field:
ArrayList<JLabel> arrayFullOfLabels = new ArrayList<JLabel>();
I have a method:
And in my constructor somewhere I call this setArrayFullOfLabels..
When I run my JFrame, I see the JLabes just fine..
I also have a button, When I click the button I want the JLabel to change..
mainFrame.arrayFullOfLabels.set(2, new JLabel("WHYYY!!!"));
But it is not working..
( The actionListener is working just fine and I have mainFrame.validate() and mainFrame.repaint() )
Re: How to Change a JLabel in a Frame when a Button is clicked?