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

📄 demoboxlayout.java

📁 基于netbeans的java桌面应用程序合集
💻 JAVA
字号:
/*
 * DemoBoxLayout.java
 *
 * Created on 2007年8月1日, 下午2:40
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package org.Adam;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
/**
 *
 * @author Administrator
 */
public class DemoBoxLayout extends JFrame{
    JButton jButtonOne,jButtonTwo,jButtonThree,jButtonFour,jButtonFive;
    
    /** Creates a new instance of DemoBoxLayout */
    public DemoBoxLayout() {
        Container con=this.getContentPane();
        con.setLayout(new BoxLayout(con,BoxLayout.Y_AXIS));
        jButtonOne=new JButton("按钮1");
        jButtonTwo=new JButton("按钮2");
        jButtonThree=new JButton("特殊按钮3");
        jButtonFour=new JButton("按钮4");
        jButtonFive=new JButton("更大的按钮5");
        con.add(jButtonOne);
        con.add(jButtonTwo);
        con.add(jButtonThree);
        con.add(jButtonFour);
        con.add(jButtonFive);
        this.setTitle("BoxLayout示例");
        this.setBounds(100,100,300,200);
        this.setVisible(true);
        this.validate();
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }
    public static void main(String[] args) {
        DemoBoxLayout dblayout=new DemoBoxLayout();
    }
}

⌨️ 快捷键说明

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