What I am trying to do is make a button that will end the frame as well as end the program but allow other parts, JOGL in this case, to do their own dispose Functions.
For instance, when I use the standard close button for the JFrame with EXIT_ON_CLOSE it will end the program but allow JOGL to do its clean up. And if I do System.exit(0) it will not allow any clean up from JOGL.
Essentially:
Custom Close JButton ===> Cleanly end application.
How about using WindowAdapter to override the WindowClosing event
this.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent ev) {
//add your logic for closing here
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With