1.常用控件
1.1--容器 JPanel
1.2--按钮 JButton
1.3--标签 JLabel
1.4--文本框 JTextField
1.5--密码框 JPasswordField
1.6--单选框 JRadioButton && ButtonGroup
1.7--复选框 JCheckBox
1.8--下拉框 JComboBox
1.9--文本域 JTextArea
2.0--滚动面板 JScrollPane
2.1--文件选择器 JFileChooser
【务必注意:将控件依次加到容器里,将容器加到窗体上,而不是直接把控件加到窗体】
2.三种布局
2.1、流式布局【默认】-->FlowLayout
2.2、边框布局-->BorderLayout 设置方位
北:North 或者 BorderLayout.NORTH
南:South
西:West
东:East
中:Center
2.3、网格布局-->GridLayout(3,3) 设置行数和列数