Page 2 of 2 FirstFirst 12
Results 21 to 25 of 25
  1. #21
    Mir
    Mir is offline Senior Member
    Join Date
    Mar 2008
    Posts
    447
    Rep Power
    7

    Default

    Quote Originally Posted by smartsubroto View Post
    Hi
    according to question you want to do the following:
    1) when the user click on yes, An Application will open the browser say Yahoo! and exit
    2) on clicking no button an Application will exit without opening the browser
    and
    3) on clicking cancel button that dialog box should be closed.

    Please tell me whether i am right or wrong with your question..
    yes you are right but on clicking cancel button that dialog box should be closed and frame not close.

    Plz help me

  2. #22
    Mir
    Mir is offline Senior Member
    Join Date
    Mar 2008
    Posts
    447
    Rep Power
    7

    Default

    Quote Originally Posted by Eranga View Post
    On the cancel option you exit the application. You are not involving with any frame there.
    Sir plz help me..

  3. #23
    Mir
    Mir is offline Senior Member
    Join Date
    Mar 2008
    Posts
    447
    Rep Power
    7

    Default

    Quote Originally Posted by Eranga View Post
    On the cancel option you exit the application. You are not involving with any frame there.
    Sir plz help me through example..

  4. #24
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Hey man, on the main frame class add a method to close the dialog first and show me it. Quite same thing you have done in your project. I already gave a code to do it.

  5. #25
    Mir
    Mir is offline Senior Member
    Join Date
    Mar 2008
    Posts
    447
    Rep Power
    7

    Default

    Quote Originally Posted by Eranga View Post
    Hey man, on the main frame class add a method to close the dialog first and show me it. Quite same thing you have done in your project. I already gave a code to do it.
    Sir this is a code.i am useing it out side the constructor..
    Java Code:
     public void processWindowEvent(WindowEvent e) {
    
            if (e.getID() == WindowEvent.WINDOW_CLOSING) {
            
                int exit = JOptionPane.showConfirmDialog(this, "Are you sure To Close The Frame?");
                if (exit == JOptionPane.YES_OPTION) {
                    System.exit(0);
                }
                
            } else {
    
                // If you do not want listeners processing the WINDOW_CLOSING
                // events, you could this next call in an else block for the:
                //     if (e.getID() ...)
                // statement. That way, only the other types of Window events
                // (iconification, activation, etc.) would be sent out.
    
                super.processWindowEvent(e);
            }
        }
    Plz help me

Page 2 of 2 FirstFirst 12

Similar Threads

  1. JVM terminated Exit code=1
    By oregon in forum Eclipse
    Replies: 3
    Last Post: 09-29-2008, 09:49 PM
  2. system.exit(..)
    By ramakanta.majhi in forum New To Java
    Replies: 2
    Last Post: 06-14-2008, 01:28 AM
  3. Problem with JOptionPane.showInputDialog()
    By romina in forum AWT / Swing
    Replies: 1
    Last Post: 08-07-2007, 05:33 AM
  4. help with System.exit (1) function call
    By katie in forum Advanced Java
    Replies: 2
    Last Post: 08-06-2007, 08:03 PM
  5. How to exit the program..
    By coco in forum New To Java
    Replies: 1
    Last Post: 08-01-2007, 05:56 PM

Posting Permissions

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