public class j_01_FLOW_06 extends JApplet implements ActionListener { //Choice shoplist = new Choice(); //ButtonGroup bg_group = new ButtonGroup(); CheckboxGroup cg_Group = new CheckboxGroup(); JCheckBox cb_i1 = new JCheckBox("fafa"); JCheckBox cb_2 = new JCheckBox("wfw"); JCheckBox cb_3 = new JCheckBox("Computer"); String s_value[]={"white sox","red sox","mets","cordianls","blue jays"}; JList l_list = new JList(s_value); Container c; FlowLayout flow = new FlowLayout(); public void init() { c = getContentPane(); c.setLayout(flow); cb_group.add(cb_1); cb_group.add(cb_2); cb_group.add(cb_3); c.add(cb_group); c.add(shoplist); } }
i want to group some jcheck buttons. so that its top to bottom. but iam getting error at :
cb_group.add(cb_1);
cb_group.add(cb_2);
cb_group.add(cb_3);
c.add(cb_group);