• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Checked JComboBox

 
Laurent Saudmont
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Indeed, i don't see how i can extend this to a combobox...
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic