📄 manage_system.java
字号:
import java.awt.*;
import java.awt.event.*;
import java.util.*;
public class Manage_System extends Frame implements ActionListener{
Menu mu,mu1,mu2,mu3,mu4,mu5;
MenuItem mt;
MenuItem mt1,mt2,mt3,mt4,mt5,mt6,mt7;
MenuBar mb;
Panel p;
Label b,b1,b2,b3;
Font myfont;
public Manage_System() {
super("图书管理系统");
mu=new Menu("图书管理");
mu1=new Menu("借阅者信息");
mu2=new Menu("还书管理");
mu3=new Menu("续借管理");
mu4=new Menu("借书管理");
mu5=new Menu("退出系统");
mt=new MenuItem("图书入库");
mt1=new MenuItem("图书查询");
mt2=new MenuItem("开户");
mt3=new MenuItem("销户");
mt4=new MenuItem("还书");
mt5=new MenuItem("继续借阅");
mt6=new MenuItem("借书");
mt7=new MenuItem("退出");
mb=new MenuBar();
p=new Panel();
myfont=new Font("TimesRoman",Font.BOLD,40);
b=new Label("图书管理系统");
b1=new Label(" ");
b2=new Label(" ");
b3=new Label(" ");
p.setBackground(Color.white);
p.setSize(200,100);
// b.setBackground(Color.green);
b.setFont(myfont);
b1.setFont(myfont);
b2.setFont(myfont);
b3.setFont(myfont);
add(p);
p.add(b1);
p.add(b2);
p.add(b3);
p.add(b);
mu.add(mt);
mu.addSeparator();
mu.add(mt1);
mb.add(mu);
setMenuBar(mb);
mu1.add(mt2);
mu1.add(mt3);
mb.add(mu1);
mu4.add(mt6);
mb.add(mu4);
mu2.add(mt4);
mb.add(mu2);
mu3.add(mt5);
mb.add(mu3);
mu5.add(mt7);
mb.add(mu5);
this.setSize(700,500);
//resize(700,500);//setSize(500,300);
setResizable(false);
this.setVisible(true);
mt.addActionListener(this);
mt1.addActionListener(this);
mt2.addActionListener(this);
mt3.addActionListener(this);
mt4.addActionListener(this);
mt5.addActionListener(this);
mt6.addActionListener(this);
mt7.addActionListener(this);
}
public boolean handleEvent(Event e){
if(e.id==Event.WINDOW_DESTROY){
this.setVisible(false);
// hide();
dispose();
System.exit(0);
return true;
}
return super.handleEvent(e);
}
public void actionPerformed(ActionEvent e){
String str=e.getActionCommand();
try{
if(str.equals("图书入库")) {
Add_Frame add=new Add_Frame();
}
// if(str.equals("图书查询")){
//Check_book chaxun=new Check_book();
//}
if(str.equals("开户")) {
KaiHuFrame kaihuframe=new KaiHuFrame();
}
if(str.equals("销户")){
EndFrame xiaohu=new EndFrame();
}
if(str.equals("借书")){
Loan_book jieshu=new Loan_book();
}
if(str.equals("还书")){
Back_book huanshu=new Back_book();
}
if(str.equals("继续借阅")){
Go_loan xujie=new Go_loan();
}
if(str.equals("退出")){
System.exit(0);
}
}catch (Exception eg) { eg.printStackTrace();}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -