This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Forcing a JComboBox to stay open Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Forcing a JComboBox to stay open" Watch "Forcing a JComboBox to stay open" New topic
Author

Forcing a JComboBox to stay open

James JVogt
Greenhorn

Joined: May 21, 2007
Posts: 6
First off: I have made a JComboBox that contains JCheckBox components inside of it
when it is expanded.

The ideal situation would be for a user to open the combobox, check off all the options they want, and then click somewhere else on the gui to make the combo box collapse.

The current situation is this:
the user opens the combo box, checks off an option and then the combo box immediately collapses so if they would like to check off another option they must open the combo box again.

I need to force the combo box to stay open until the user clicks another area of the gui.
[ May 21, 2007: Message edited by: Matt Crinklaw ]
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
You might be better off building a custom component rather than either fighting with
JComboBox or writing/extending plaf code to change the behavior.
You could make a JButton that shows a JList (in a JWindow set just below the button) that
can take multiple selections. You could change the text on the button and use it for the
close/apply/all_finished_with_selections part.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Forcing a JComboBox to stay open