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

📄 demoflowlayout.java

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

package org.Adam;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
/**
 *
 * @author Administrator
 */
public class DemoFlowLayout extends JFrame implements ActionListener{
    JButton buttonAction;
    /** Creates a new instance of DemoFlowLayout */
    public DemoFlowLayout() {
        this.setLayout(new FlowLayout());
        buttonAction=new JButton("动作按钮");
        buttonAction.addActionListener(this);
        this.add(buttonAction);
        this.setBounds(150,150,350,120);
        this.setTitle("FlowLayout完整示例");
        this.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    }

    public void actionPerformed(ActionEvent e) {
        if(e.getSource()==buttonAction){
            JButton buttonCommon=new JButton("普通按钮");
            this.add(buttonCommon);
            this.validate();
        }
        
    }
    public static void main(String[] args) {
        new DemoFlowLayout().setVisible(true);
    }
}

⌨️ 快捷键说明

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