JAVA Swing - Setting JLabel equal to a String in another class

前端 未结 3 915
死守一世寂寞
死守一世寂寞 2020-12-21 21:02

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.

3条回答
  •  北荒
    北荒 (楼主)
    2020-12-21 21:11

    There are two possibilities.

    First is to update the text l.setText(b.getTheUserInput()); other option is that you did not add the label to a container.

提交回复
热议问题