Results 1 to 2 of 2
  1. #1
    Gladiat0r is offline Member
    Join Date
    Mar 2012
    Location
    United States
    Posts
    1
    Rep Power
    0

    Default JOptionPane.showInputDialog with only 1 correct answer

    Is there a way to set only 1 or 2 possible answers to a JOptionPane.showInputDialog? I am trying to write a basic program that will only accept 1 or 2 answers and different things will result if you answer correctly or not.

    Thank You.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,238
    Rep Power
    19

    Default Re: JOptionPane.showInputDialog with only 1 correct answer

    Use showOptionDialog

    If that's not what you were looking for, post a SSCCE (Short, Self Contained, Compilable and Executable) example that demonstrates your problem.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Compare true Answer /Player answer
    By Eilime in forum New To Java
    Replies: 1
    Last Post: 04-24-2011, 08:51 PM
  2. why my coding cannot give the correct answer?
    By qema in forum New To Java
    Replies: 5
    Last Post: 03-03-2009, 05:52 PM
  3. JOptionPane.showInputDialog
    By mayhewj7 in forum New To Java
    Replies: 5
    Last Post: 02-25-2009, 06:04 AM
  4. guss which is correct answer
    By abhinav_jain09 in forum Java Applets
    Replies: 4
    Last Post: 09-19-2008, 02:39 AM
  5. Problem with JOptionPane.showInputDialog()
    By romina in forum AWT / Swing
    Replies: 1
    Last Post: 08-07-2007, 05: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
  •