How can I refresh or reload the JFrame?(如何刷新或重新加载 JFrame?)
问题描述
我正在使用 Java 进行项目,因此我需要在单击该 JFrame
上的特定按钮后重新加载整个 JFrame
.如何做到这一点?
I am doing project using Java and in that I need to reload whole JFrame
after clicking particular button on that JFrame
. How to do this?
推荐答案
试试
SwingUtilities.updateComponentTreeUI(frame);
如果还是不行,那么在完成上述步骤后尝试
If it still doesn't work then after completing the above step try
frame.invalidate();
frame.validate();
frame.repaint();
这篇关于如何刷新或重新加载 JFrame?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!