Java – How to refresh or reload the JFrame?

javajframeswing

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?

Best Answer

Try

SwingUtilities.updateComponentTreeUI(frame);

If it still doesn't work then after completing the above step try

frame.invalidate();
frame.validate();
frame.repaint();