Java中的常用组件
常用组件
JLable 标签 构造可以传文字,图片,Iocn
JButton 按钮
JTextField 文本域
JComboBox 下拉列表
JCheckBox 复选框
JRadioButton 单选框
import javax.swing.ButtonGroup;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class ComponentTest {
public static void main(String[] args) {
new MyFrame03();
}
}
class MyFrame03 extends JFrame{
JPanel panel;
JLabel label;
JButton button;
JTextField jTextField;
JComboBox comboBox;
JCheckBox checkBox1;
JRadioButton radioButton1;
JRadioButton radioButton2;
JRadioButton radioButton3;
ButtonGroup bg1;
ButtonGroup bg2;
JCheckBox checkBox2;
p