What function is used to make menuBarItem exit close program
Printable View
What function is used to make menuBarItem exit close program
There are different ways. You can invoke:
orCode:System.exit();
Code:frame.dispose();
Buit I prefer to use the ExitAction from: Closing an Application « Java Tips Weblog. This will behave just like the user clicked on the "Close" button of the frame, which is important if you ever have and standard processing that is done when a frame is closed.