I am making a java pong game using swing. I want to close the frame whenever a player wins or losses and the gameOver frame shows. I used the frame.dispose() method but it w