Click here to Skip to main content
15,893,622 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am trying to add jcheckbox in jcombobox in java, but instead of checkbox in combo its showing as javax.swing.jcheckbox[&.] like in the jcombobox
could you please help me out

What I have tried:

JCheckBox check1 = new JCheckBox("One");
JCheckBox check2 = new JCheckBox("two");
JCheckBox check3 = new JCheckBox("One");
JCheckBox check4 = new JCheckBox("two");
JCheckBox check5 = new JCheckBox("One");
JCheckBox check6 = new JCheckBox("two");
JCheckBox check7 = new JCheckBox("One");
JCheckBox check8 = new JCheckBox("two");


JCheckBox[] myList = { check1, check2, check1, check2, check1, check2, check1, check2,check1, check2, check1, check2, check1, check2, check1, check2,check1, check2, check1, check2, check1, check2, check1, check2};

jBMCCheckComboNew = new JComboBox(myList);
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900