⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 borderlayoutdemo.java

📁 精通JBuilder2006 源代码 精通JBuilder2006 源代码
💻 JAVA
字号:
package chapter6.layout;

import java.awt.*;
import javax.swing.*;

public class BorderLayoutDemo extends JFrame {

    public BorderLayoutDemo() {
        Container contentPane = this.getContentPane();
        contentPane.setLayout(new BorderLayout());
        contentPane.add(new JButton());
        contentPane.add(BorderLayout.NORTH, new Button("one"));
        contentPane.add(BorderLayout.SOUTH, new Button("two"));
        contentPane.add(BorderLayout.EAST, new Button("three"));
        contentPane.add(BorderLayout.WEST, new Button("four"));
        contentPane.add(BorderLayout.CENTER, new Button("five"));
        this.setTitle("BorderLayoutDemo");
        this.setSize(600, 300);
        this.setLocation(400, 400);
        this.setVisible(true);
    }

    public static void main(String[] args) {
        BorderLayoutDemo test = new BorderLayoutDemo();
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -