[JAVA] Close a JFrame
Solved
john93
-
Wololo -
Wololo -
Hello,
I want to close a JFrame window with a quit button.
I see how to handle the button event, but I don't know what to put to close this window.
Thank you for your help.
I want to close a JFrame window with a quit button.
I see how to handle the button event, but I don't know what to put to close this window.
Thank you for your help.
Configuration: Windows XP Firefox 2.0.0.12
3 answers
-
If you have instantiated an object of type JFrame and you manage it from another class, you do:
monObjectJFrame.dispose();
If you handle the event inside your own class (which extends JFrame), you do:this.dispose();
It should normally work.
--
~ Don't forget the "Resolved" tag when your problem is... resolved :) ~