JFrame will not close giving null pointer exception
Hello ev1, Heres what I'm doing, I have a menu with JButtons that when pressed will take you to a game (this works fine). When your done with the game, you press a button that closes the JFrame(game) and starts the menu again (this gives the error null pointer exception). Heres a brief summary of the design:
FullScreenSetup class
has openWindow() that sets up a new full screen JFrame. (works)
has closeWindow() that removes everything in the contentPane and sets
visible(false).
GameMenu class
uses FullScreenSetup via FullScreenSetup window;
uses window.openWindow() to set up the window.
also sets up the buttons and handles them when pressed
VideoPoker class (the game)
uses FullScreenSetup via FullScreenSetup window;
runs the game and has the button that should close the window and go
back to the menu.
heres how i thought it should work, in the actionPerformed method I have
window.closeWindow(); <- this gives me the error
new GameMenu(); <- this is my ultimate goal (hopefully brings me
back to the menu screen to choose another game)
I hope what I have written is enough for someone to help me because I know what it is like to read through hundreds of lines of code to help someone. Thx.

