Results 1 to 3 of 3
  1. #1
    itaipee is offline Member
    Join Date
    Dec 2008
    Rep Power

    Default quick choises in JoptionPane

    Hey everybody

    I'm using joptionPane for chosing from list.

    The problem is that is too demanding - when the dialog is opened , first i have to press the arrow that show the list possibilities, then chose my option , and then - confirm with ok.

    How can I speed things up - - so the list will automaticly apears and removing the need for confirm ?

    Java Code:
    String s = (String)JOptionPane.showInputDialog(
    			                    "Chose From the list",
    			                    "Customized Dialog",

  2. #2
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Rep Power


    The short answer, as far as I know, is "no".

    Some Swing components are very good about allowing you to type the first letter of the option, and the list will shift to that point. I believe JComboBox does that, which is part of JOptionPane. Also, JTree allows you to type several letters, and it will continue positioning the list to the specific list entry that starts with those letters.

    All I can suggest is to try out typing characters...

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Colombo, Sri Lanka
    Blog Entries
    Rep Power


    Yes, this is not possible with input dialogs. As Steve says, JComboBox do that. Search the forum, you can find the quite similar example coded by hardwired.

Similar Threads

  1. Need help quick!
    By Manikyr in forum New To Java
    Replies: 11
    Last Post: 01-28-2009, 04:08 AM
  2. One last quick question
    By jigglywiggly in forum New To Java
    Replies: 7
    Last Post: 01-26-2009, 08:53 AM
  3. Quick Question
    By Graeme in forum New To Java
    Replies: 4
    Last Post: 01-08-2009, 08:01 PM
  4. Quick Question
    By Spenc in forum New To Java
    Replies: 3
    Last Post: 09-22-2008, 02:26 PM
  5. Quick Help Please! Can't Run Code!!
    By VinceGuad in forum Eclipse
    Replies: 4
    Last Post: 01-16-2008, 03:54 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