Results 1 to 4 of 4
- 03-19-2010, 07:23 AM #1
Member
- Join Date
- Mar 2009
- Posts
- 48
- Rep Power
- 0
how to create more than one drop-down list in single JOptionInput Dialog ?
hi,
anybody can tell me please how to create more than one drop-down list or combo box in a single JOptionInput dialog ??
suppose, my program want to ask "select any three of your Favorite animals ".. then how can i set it ??
Java Code:Object[] selectionValues1 = { "Pandas", "dogs", "Cats", "Deers", "Monkeys", "Birds" }; String initialSelection1 = "Dogs"; Object[] selectionValues2= {"Pandas", "dogs", "Cats", "Deers", "Monkeys", "Birds"} ; String initialSelection2="Cats"; Object selection1 = JOptionPane.showInputDialog(null, "Select any three of your favorite animals?", "Zoo Quiz", JOptionPane.QUESTION_MESSAGE, null, selectionValues1, initialSelection1);what we are thinking, it might not be true
-
You'll likely need to create two JComboBoxes, place them in a JPanel and then place that JPanel into the JOptionPane's Object parameter.
- 03-19-2010, 03:58 PM #3
Senior Member
- Join Date
- Jul 2009
- Posts
- 1,158
- Rep Power
- 5
And once you add the panel to the JOptionPane you may want to consider the Dialog Focus suggestion.
- 03-20-2010, 04:03 AM #4
Member
- Join Date
- Mar 2009
- Posts
- 48
- Rep Power
- 0
Similar Threads
-
how to create gui(swing)by eclipse drag and drop type
By javastuden in forum EclipseReplies: 1Last Post: 03-14-2010, 10:03 PM -
Populating a drop down list from a database
By matpj in forum New To JavaReplies: 0Last Post: 01-19-2009, 12:14 PM -
How to create your own dialog classes in SWT
By Java Tip in forum SWTReplies: 0Last Post: 07-02-2008, 07:54 PM -
How to create a Dialog Shell
By Java Tip in forum SWTReplies: 0Last Post: 07-02-2008, 07:52 PM -
JComboBox and drop-down list.....HELP!!!!!
By Anna in forum AWT / SwingReplies: 1Last Post: 06-18-2008, 05:16 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks