aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Checked JComboBox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Checked JComboBox" Watch "Checked JComboBox" New topic
Author

Checked JComboBox

Laurent Saudmont
Greenhorn

Joined: Jul 05, 2002
Posts: 5
I would like to create a JComboBox with JCheckBox as item in the combobox.
Is it possible? How can i do that?
Great thanks for your response
Neil Marsden
Greenhorn

Joined: May 31, 2002
Posts: 6
Is using a JCheckBoxMenuItem an option?
A JMenu is, for all intensive purposes, a comboBox
and can be placed in a JPanel nested within a JMenuBar.
I suppose the more difficult approach would be to extend the JComboBox class...?
regards,
Neil
Laurent Saudmont
Greenhorn

Joined: Jul 05, 2002
Posts: 5
Indeed, i don't see how i can extend this to a combobox...
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

You should be making custom ListCellRenderers and ComboBoxEditors to make a check box appear in a Combo box...

Here is some example code of how to do this...



-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Checked JComboBox