drive.java
来自「班级管理查询系统」· Java 代码 · 共 61 行
JAVA
61 行
package huazheng;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
public class Drive {
public void huazheng(){
JFrame frame=new JFrame("操作");
final JButton j1,j2,j3,j4;
j1=new JButton("查找");
j2=new JButton("添加");
j3=new JButton("删除");
j4=new JButton("退出");
frame.setSize(200,200);
frame.setLocation(300,300);
frame.setAlwaysOnTop(true);
// frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setResizable(false);
frame.setLayout(null);
frame.add(j1);
frame.add(j2);
frame.add(j3);
frame.add(j4);
j1.setBounds(10,20,60,30);
j2.setBounds(90,20,60,30);
j3.setBounds(10,70,60,30);
j4.setBounds(90,70,60,30);
j4.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
if(e.getSource()==j4)
System.exit(0);
}
});
j1.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
new Find().find();
}
});
j2.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
Mangament m = new Mangament();
m.Welcome();
}
});
j3.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
}
});
frame.setVisible(true);
}
public static void main(String[] args) {
new Drive().huazheng();
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?