欢迎来到天天文库
浏览记录
ID:38799368
大小:14.20 KB
页数:5页
时间:2019-06-19
《基于java的图书馆理系统的学生界面查询功能实现》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、packagelibrary;importjava.awt.BorderLayout;importjava.awt.Font;importjava.awt.GridLayout;importjava.awt.Panel;importjava.awt.event.ActionEvent;importjava.awt.event.ActionListener;importjava.sql.ResultSet;importjava.sql.SQLException;importjava.sql.Statement;importjava
2、.util.Vector;importjavax.swing.JButton;importjavax.swing.JComboBox;importjavax.swing.JFrame;importjavax.swing.JLabel;importjavax.swing.JOptionPane;importjavax.swing.JPanel;importjavax.swing.JScrollPane;importjavax.swing.JTable;importjavax.swing.JTextField;importjavax
3、.swing.JToolBar;importjavax.swing.table.DefaultTableModel;publicclassqueryextendsJFrameimplementsActionListener{privatestaticfinalintAUTO_RESIZE_OFF=0;privatestaticfinalbooleanJComboBox=false;privateJTextFieldidfield;privateJTextFieldnamefield;privateJTextFieldcatefi
4、eld;privateJTextFieldauthorfield;privateJButtonquerybutton;privateDbTableModeltableModel;privateResultSetrs;privateStringidtext;privateStringnametext;privateStringauthortext;privateJComboBoxbox;privateStringstring;privateObjectselectedItem;publicquery(){init();}priva
5、tevoidinit(){setDefaultCloseOperation(EXIT_ON_CLOSE);setBounds(200,200,470,400);setTitle("图书信息查询");JPanelpanel=newJPanel();add(panel,BorderLayout.NORTH);panel.setLayout(newBorderLayout());JLabellabel=newJLabel("高级搜索",JLabel.CENTER);label.setFont(newFont("宋体",Font.BOL
6、D,12));panel.add(label,BorderLayout.WEST);Panelpanel2=newPanel();panel.add(panel2,BorderLayout.CENTER);panel2.setLayout(newGridLayout(4,2));JLabelidlabel=newJLabel("编号",JLabel.CENTER);panel2.add(idlabel);idfield=newJTextField();panel2.add(idfield);JLabellabelauthor=n
7、ewJLabel("作者",JLabel.CENTER);panel2.add(labelauthor);authorfield=newJTextField();panel2.add(authorfield);JLabelnamelabel=newJLabel("书名",JLabel.CENTER);panel2.add(namelabel);namefield=newJTextField();panel2.add(namefield);JLabelcatelabel=newJLabel("分类",JLabel.CENTER);
8、panel2.add(catelabel);box=newJComboBox();panel2.add(box);box.addItem("———————————");JToolBartoolBar=newJToolBar();toolBar.setFloata
此文档下载收益归作者所有