This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes drop down multiple selection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "drop down multiple selection" Watch "drop down multiple selection" New topic
Author

drop down multiple selection

andy keidel
Greenhorn

Joined: Mar 01, 2004
Posts: 5
JComboBox doesn't support multiple selection. JMenu does. But JMenu seems to be designed only for going in JMenuBars, which are in the top section of the frame. Sure, you CAN put the JMenu/JMenuBar elsewhere, but it tends to look really bad in most LnFs.
So how can I get something in a random part of my JFrame that LOOKS nice like a JComboBox but allows MULTIPLE selection like a JMenu?
I don't want a JList, which doesn't drop down and looks like crap.
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

JComboBox doesn't support multiple selection because it doesn't make sense... the user selects one value from the popup list and then that one value is displayed in the closed combobox. How are you going to show that multiple values are selected?

I don't understand what you mean by JMenus support multiple selection (unless you are talking about using JCheckBoxMenuItems? ) Basically all a JMenu is is a JButton that launches a JPopupMenu containing the menu items that the menu contains... it's not like you can launch the File menu and select open through exit... you can only select one option at a time.

It sounds like you might get what you want by making a regular JButton that launches a JPopupMenu with JCheckBoxMenuItems in it, instead of using JMenu.


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
 
Don't get me started about those stupid light bulbs.
 
subject: drop down multiple selection
 
Similar Threads
What is the syntax for a "drop down menu"?
JComboBox in the JTable Editor
JCombobox in JTable cell does not dropdown
JComboBox disabling not Successfull
JComboBox drop-down list extends past JDialog boundary