bton.java

来自「笔记的管理」· Java 代码 · 共 58 行

JAVA
58
字号
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package bt;import java.awt.FlowLayout;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import javax.swing.JButton;import javax.swing.JFrame;/** * * @author Administrator */public class bton extends JFrame {    JButton a1 = new JButton("查询");    JButton a2 = new JButton("添加");   JButton a3=new JButton("退出");      public bton() {        super("笔记管理");        setLayout(new FlowLayout());        add(a1);        add(a2);        add(a3);        setSize(300, 200);        setVisible(true);        a1.addActionListener(new ActionListener() {            public void actionPerformed(ActionEvent e) {                         btn2 b2=new btn2();         setVisible(false);            }         });        a2.addActionListener(new ActionListener() {            public void actionPerformed(ActionEvent e) {                btn21 b=new btn21();                setVisible(false);            }        });        a3.addActionListener(new ActionListener() {          public void actionPerformed(ActionEvent e) {               System.exit(0);            }       });    }}

⌨️ 快捷键说明

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