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

    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(
    			                    parent1,
    			                    "Chose From the list",
    			                    "Customized Dialog",
    			                    JOptionPane.PLAIN_MESSAGE,
    			                    null,
    			                    listText,
    			                    listText[0]);

  2. #2
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    1,046
    Rep Power
    7

    Default

    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
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    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
  •