标签:style blog java color for new
package Gui; /** * check box must be in a same ButtonGroup can`t be selected * at the same time * * */ import javax.swing.*; import java.awt.*; public class CheckBoxDemo extends JFrame{ public void launch(){ ButtonGroup bp = new ButtonGroup(); JCheckBox[] cb = new JCheckBox[10]; for(int i = 0 ;i<10;i++){ cb[i] = new JCheckBox("cb"+i); bp.add(cb[i]); add(cb[i]); } setLayout(new FlowLayout()); setBounds(600,200,300,300); setVisible(true); } public static void main(String[] args) { CheckBoxDemo bbb = new CheckBoxDemo(); bbb.launch(); } }
single checkbox demo,布布扣,bubuko.com
标签:style blog java color for new
原文地址:http://www.cnblogs.com/oaks/p/3818266.html