| Author |
Combo box selection
|
Cathy Song
Ranch Hand
Joined: Jul 01, 2003
Posts: 92
|
|
Hi Ranchers, I was wondering if it is possible to select more than one items in a combo box (using ctrl key). Thanks, Cathy.
|
 |
Tim McGuire
Ranch Hand
Joined: Apr 30, 2003
Posts: 819
|
|
|
JComboBoxes are single selection. For multiple selection, use a JList
|
 |
Cathy Song
Ranch Hand
Joined: Jul 01, 2003
Posts: 92
|
|
Thank for your reply David. Instead of having to scroll, can I make the list have a pull down feature like combo box. I want a component that would be pull down and allow multiple selection. Will I need to create a custom component? Thanks, Cathy.
|
 |
Tim McGuire
Ranch Hand
Joined: Apr 30, 2003
Posts: 819
|
|
It sounds like you want to use a JComboBox to trigger a little popup screen. This is done with the ComboPopup interface: http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/plaf/basic/ComboPopup.html A good example of this in use is the DateComboBox: here is the code to that: http://www.developer.com/java/article.php/735291 if you load that and run it, you can imagine your list component in the popup instead of their date component. [ May 20, 2004: Message edited by: Tim McGuire ]
|
 |
Cathy Song
Ranch Hand
Joined: Jul 01, 2003
Posts: 92
|
|
Thanks for your reply Tim. -Cathy.
|
 |
 |
|
|
subject: Combo box selection
|
|
|