Results 1 to 8 of 8
  1. #1
    sh4rif is offline Member
    Join Date
    Dec 2011
    Posts
    16
    Rep Power
    0

    Default Java exit command...

    Hello folks

    does anyone know to exit only the form not the application
    apart from System.exit(0) because this command will exit the whole application........ but i only want to exit from the current form bceause my application has multiple forms thanks.

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,879
    Rep Power
    8

    Default Re: Java exit command...

    What's a form?

    The API is your best friend: Java Platform SE 6
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    sh4rif is offline Member
    Join Date
    Dec 2011
    Posts
    16
    Rep Power
    0

    Default Re: Java exit command...

    i am using AWT (abstract window toolkit) Frame class

  4. #4
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,879
    Rep Power
    8

    Default Re: Java exit command...

    Quote Originally Posted by sh4rif View Post
    i am using AWT (abstract window toolkit) Frame class
    Is there a reason you're not using Swing? And have you looked at the API for useful functions?
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  5. #5
    Join Date
    Jan 2010
    Posts
    19
    Rep Power
    0

    Default Re: Java exit command...

    Quote Originally Posted by sh4rif View Post
    does anyone know to exit only the form not the application
    apart from System.exit(0) because this command will exit the whole application........ but i only want to exit from the current form bceause my application has multiple forms thanks.
    I believe you can use the method "dispose()" from the class Window.
    Last edited by Gilvan Justino; 01-18-2012 at 12:22 AM.

  6. #6
    sh4rif is offline Member
    Join Date
    Dec 2011
    Posts
    16
    Rep Power
    0

    Default Re: Java exit command...

    "dispose()" can only be used with java SWING, not with java AWT.

  7. #7
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

  8. #8
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,565
    Rep Power
    12

    Default Re: Java exit command...

    Quote Originally Posted by sh4rif View Post
    "dispose()" can only be used with java SWING, not with java AWT.
    Compiler message, or runtime error please.

Similar Threads

  1. Exit in java
    By deepali in forum Advanced Java
    Replies: 2
    Last Post: 12-28-2011, 09:36 AM
  2. Java Result:-1....on calling exit
    By Cosmos in forum New To Java
    Replies: 2
    Last Post: 07-19-2011, 10:15 PM
  3. Exit command prompt
    By newbieph in forum New To Java
    Replies: 4
    Last Post: 03-28-2011, 09:16 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. Unable to execute command line command in java
    By LordSM in forum New To Java
    Replies: 1
    Last Post: 08-08-2007, 12:23 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
  •