Display text to a label from another class - JFrame

前端 未结 5 557
感情败类
感情败类 2021-01-16 22:45

I have a GUI screen, and it has a label in it. I now want to set the label with a text as i have shown in below (Test). But it\'s not getting updated. I think t

5条回答
  •  隐瞒了意图╮
    2021-01-16 23:47

    Replace the try block with;

                try {
                    setVisible(true);
                } catch (Exception e) {
                    e.printStackTrace();
                }
    

    Everything works!

提交回复
热议问题