📄 gridlayoutpanel.java
字号:
package layouttest;import java.awt.*;import javax.swing.*;public class GridLayoutPanel extends JPanel { GridLayout gridLayout1 = new GridLayout(); ButtonGroup buttonGroup1 = new ButtonGroup(); JRadioButton jRadioButton1 = new JRadioButton(); JRadioButton jRadioButton2 = new JRadioButton(); JRadioButton jRadioButton3 = new JRadioButton(); JRadioButton jRadioButton4 = new JRadioButton(); JRadioButton jRadioButton5 = new JRadioButton(); public GridLayoutPanel() { try { jbInit(); } catch(Exception ex) { ex.printStackTrace(); } } void jbInit() throws Exception { jRadioButton1.setText("jRadioButton1"); gridLayout1.setRows(5); gridLayout1.setColumns(1); this.setLayout(gridLayout1); jRadioButton2.setText("jRadioButton2"); jRadioButton3.setText("jRadioButton3"); jRadioButton4.setText("jRadioButton4"); jRadioButton5.setText("jRadioButton5"); this.add(jRadioButton1, null); this.add(jRadioButton2, null); this.add(jRadioButton3, null); this.add(jRadioButton4, null); this.add(jRadioButton5, null); buttonGroup1.add(jRadioButton5); buttonGroup1.add(jRadioButton1); buttonGroup1.add(jRadioButton2); buttonGroup1.add(jRadioButton3); buttonGroup1.add(jRadioButton4); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -