Results 1 to 4 of 4
  1. #1
    coollucky is offline Member
    Join Date
    Nov 2011
    Posts
    9
    Rep Power
    0

    Default Question Message

    Hello everyone! I apologize if this question has been asked before... I'm using a JOptionPanes QUESTION_MESSAGE with YES_NO option, but I have no idea how to get response from YES/NO buttons. Please can someone help me?

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

    Default Re: Question Message

    I assume that you're talking about using JOptionPane's showConfirmDialog method, correct? The API for this method shows that it returns an int, and then you simply check with if blocks if the int returned is one of the JOptionPane int constants, JOptionPane.YES_OPTION or JOptionPane.NO_OPTION.

  3. #3
    coollucky is offline Member
    Join Date
    Nov 2011
    Posts
    9
    Rep Power
    0

    Default Re: Question Message

    Quote Originally Posted by Fubarable View Post
    I assume that you're talking about using JOptionPane's showConfirmDialog method, correct? The API for this method shows that it returns an int, and then you simply check with if blocks if the int returned is one of the JOptionPane int constants, JOptionPane.YES_OPTION or JOptionPane.NO_OPTION.
    Thank You!

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

Similar Threads

  1. Error Message
    By Bimz in forum New To Java
    Replies: 2
    Last Post: 09-11-2011, 02:01 PM
  2. Run message only once
    By aconti in forum New To Java
    Replies: 2
    Last Post: 06-01-2011, 09:19 PM
  3. Anyone else get this private message?
    By Fubarable in forum New To Java
    Replies: 20
    Last Post: 03-18-2011, 12:26 PM
  4. Replies: 6
    Last Post: 06-04-2010, 09:43 PM
  5. jms message passing
    By kirtichopra2003 in forum Advanced Java
    Replies: 0
    Last Post: 09-15-2009, 08:33 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
  •