if("Back".equals(e.getActionCommand()))
{
escape.setVisible(false);
paused = false;
running = !running;
Graphics g = start.getGraphics();
g.dispose();
Component glassPane = start.getGlassPane();
glassPane.setVisible(!glassPane.isVisible());
Main.main(null);
Main.running = true;
start.dispose();
}
This is my code for disabling my jframe, loading a new one, and disposing it. Whenever I do this, when I return to the frame I get strange graphical errors.

How do I close the frame completly?
create
private/public(depends of your code design) variable forJFrameinstancethen you can’t bothering with dispose of visible
JFrameand then re_create a new onecreate
classorlocal instacethat returnsJPanelwith game contentcall
JFrame#getContentPane#removeAll()call
JFrame#getContentPane#add(new GamePanel())maybe there are easiest ways how to reset whatever (depends of your code design) to the start_up statuses