📄 flowlayouttest.java
字号:
package chapter7.layout;
import java.awt.*;
import javax.swing.JButton;
public class FlowLayoutTest
extends Frame
{
FlowLayout flowLayout1 = new FlowLayout();
JButton jButton1 = new JButton();
JButton jButton2 = new JButton();
JButton jButton3 = new JButton();
public FlowLayoutTest()
{
try
{
jbInit();
}
catch (Exception exception)
{
exception.printStackTrace();
}
}
private void jbInit()
throws Exception
{
this.setLayout(flowLayout1);
jButton1.setText("jButton1");
jButton2.setText("jButton2");
jButton3.setText("jButton3");
this.add(jButton1);
this.add(jButton2);
this.add(jButton3);
}
public static void main(String[] args)
{
FlowLayoutTest flow = new FlowLayoutTest();
flow.setSize(300,80);
flow.setVisible(true);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -