Results 1 to 3 of 3
  1. #1
    mDennis10 is offline Member
    Join Date
    Jul 2011
    Posts
    76
    Rep Power
    0

    Default MenuBarItem exit

    What function is used to make menuBarItem exit close program

  2. #2
    camickr is online now Senior Member
    Join Date
    Jul 2009
    Posts
    1,236
    Rep Power
    7

    Default

    There are different ways. You can invoke:

    Java Code:
    System.exit();
    or

    Java 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.

  3. #3
    mDennis10 is offline Member
    Join Date
    Jul 2011
    Posts
    76
    Rep Power
    0

    Default

    Quote Originally Posted by camickr View Post
    There are different ways. You can invoke:

    Java Code:
    System.exit();
    or

    Java 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.
    thanks alot it worked fine

Similar Threads

  1. JOptionPane to Exit
    By Lazairus in forum Java Applets
    Replies: 0
    Last Post: 12-02-2010, 10:36 PM
  2. How to erase self and exit
    By jnadelman in forum AWT / Swing
    Replies: 0
    Last Post: 09-27-2010, 03:04 PM
  3. Exit System
    By jboy in forum New To Java
    Replies: 5
    Last Post: 09-14-2009, 08:27 AM
  4. How to exit the program by typing "exit"?
    By Laythe in forum New To Java
    Replies: 6
    Last Post: 08-19-2009, 08:32 PM
  5. system.exit(..)
    By ramakanta.majhi in forum New To Java
    Replies: 2
    Last Post: 06-14-2008, 01:28 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •