📄 menu3_1.java
字号:
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import javax.swing.table.*;
public class Menu3_1 extends JFrame implements ActionListener
{
JLabel label_1=new JLabel("书名:");
JLabel label_2=new JLabel("分类:");
JLabel label_3=new JLabel("排架号:");
JTextField txt_1=new JTextField("");
String department[]={"计算机","数学","外语"};
JComboBox bbox_1=new JComboBox(department);
String Put[]={"A-001","A-002","A-003"};
JComboBox bbox_2=new JComboBox(Put);
JButton btn_1=new JButton("综合查询");
JButton btn_2=new JButton("退出");
JTable tb;
JTabbedPane tab=new JTabbedPane();
String col[]={"编号","书名","作者","分类名","排架名","出版社","出版日期","入库日期","价格","简介"};
String rows[][]=new String[15][10];
JScrollPane jsp;
public Menu3_1()
{
init();
//-------------------添加监听者-----------------------------
btn_2.setEnabled(false);//-------------先注掉更新按钮
btn_1.addActionListener(this);
btn_2.addActionListener(this);
}
public void init()
{
this.setTitle("图书详细查询");
JPanel jp_1=new JPanel();
jp_1.setLayout(new GridLayout(3,2));
jp_1.add(label_1);
jp_1.add(txt_1);
jp_1.add(label_2);
jp_1.add(bbox_1);
jp_1.add(label_3);
jp_1.add(bbox_2);
JPanel jp_2=new JPanel();
jp_2.add(btn_1);
jp_2.add(btn_2);
JPanel jp_3=new JPanel();
tb=new JTable(rows,col);
jsp=new JScrollPane(tb);
jp_3.setLayout(new BorderLayout());
jp_3.add(jp_1,BorderLayout.NORTH);
jp_3.add(jsp,BorderLayout.CENTER);
jp_3.add(jp_2,BorderLayout.SOUTH);
this.getContentPane().add(jp_3);
this.setLocation(200,00);
this.setSize(400,400);
this.setVisible(true);
JFrame.setDefaultLookAndFeelDecorated(true);
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==btn_1)
this.integration_search();
if(e.getSource()==btn_2)
this.dispose();
}
public void integration_search()
{
}
public static void main(String arg[])
{
JFrame.setDefaultLookAndFeelDecorated(true);
Menu3_1 frm=new Menu3_1();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -