You never set the window field to anything so it's null to begin with. I'm guessing you want it to dispose of the current window so in your constructor you can set window to this.
Better yet,...
Type: Posts; User: helloworld922
You never set the window field to anything so it's null to begin with. I'm guessing you want it to dispose of the current window so in your constructor you can set window to this.
Better yet,...
System.exit() will terminate your program, full stop (well, there are a few bits of code you can get to run after/inside of System.exit(), but essentially it's the end).
The primary reason not to...
The method you are looking for is called dispose.