JAVA Swing - Setting JLabel equal to a String in another class
问题 I have a method called getTheUserInput in a class which returns a String which updates based on user actions, which is located inside a class called Board.java. I have action which adds data to a String which I know works. In my other class I have a JLabel which has been set to equal the returned String of the method, as follows: JLabel l = new JLabel(b.getTheUserInput()); However, when I run the application no matter what input the user provides, the string updates, but the JLabel stays