btn2.java

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

JAVA
60
字号
/* * 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 btn2 extends JFrame{JButton a1 = new JButton("作者");JButton a2 = new JButton("主题");JButton a3 = new JButton("题目");JButton a4 = new JButton("日期");public btn2() {        super("查询");        setLayout(new FlowLayout());        add(a1);        add(a2);        add(a3);        add(a4);        setSize(300, 200);        setVisible(true);        a1.addActionListener(new ActionListener() {            public void actionPerformed(ActionEvent e) {        btn31 bt=new btn31();        setVisible(false);            }        });        a2.addActionListener(new ActionListener() {            public void actionPerformed(ActionEvent e) {                btn32 bt=new btn32();                setVisible(false);            }        });        a3.addActionListener(new ActionListener() {            public void actionPerformed(ActionEvent e) {                btn33 bt=new btn33();                setVisible(false);            }        });        a4.addActionListener(new ActionListener() {            public void actionPerformed(ActionEvent e) {                btn34 bt=new btn34();                            }        });}}

⌨️ 快捷键说明

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