fillerdemo.java
来自「精通JBuilder2006 源代码 精通JBuilder2006 源代码」· Java 代码 · 共 26 行
JAVA
26 行
package chapter6.layout.BoxLayout;
import java.awt.*;
import javax.swing.*;
public class FillerDemo extends JFrame {
public FillerDemo() {
Container contentPane = this.getContentPane();
Box box = new Box(BoxLayout.X_AXIS); //水平方式
contentPane.add(box);
box.add(new JButton("one"));
box.add(new Box.Filler(new Dimension(100, 100), new Dimension(200, 100),
new Dimension(300, 300)));
box.add(new JButton("two"));
this.setTitle("FillerDemo");
this.setSize(500, 100);
this.setLocation(400, 400);
this.setVisible(true);
}
public static void main(String[] args) {
FillerDemo test = new FillerDemo();
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?