初学Swing,简单记录一下自己的学习历程。希望回头看看时可以笑笑自己那曾经的过去…
This class is used to create a multiple-exclusion scope for a set of buttons. Creating a set
of buttons with the same object means that turning "on" one of those buttons turns off
all other buttons in the group.
先看一下结果吧
附一段代码 import java.awt.BorderLayout;
import javax.swing.JFrame;
import javax.swing.JRadioButton;
import javax.swing.ButtonGroup;
import javax.swing.JPanel;
public class ButtonGroups extends JFrame {
/*Four RadioButton*/
private JRadioButton button1 = new JRadioButton("China");
private JRadioButton button2 = new JRadioButton("USA");
private JRadioButton button3 = ne