package guomeiling.frame;
import guomeiling.file.BookExport;
import guomeiling.file.BookImport;
import guomeiling.model.Book;
import guomeiling.service.BookDAO;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import javax.swing.*;
import javax.swing.table.DefaultTableModel;
/**
* 实现物料列表窗口
* @author
*/
public class BookListFrame extends JFrame {
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton3;
private javax.swing.JButton jButton4;
private javax.swing.JButton jButton5;
private javax.swing.JButton jButton6;
private javax.swing.JButton jButton7;
private javax.swing.JButton jButton8;
private javax.swing.JButton jButton9;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTable jTable1;
private javax.swing.JTextField jTextField1;
private javax.swing.JTextField jTextField2;
//设一个二维数组,用来存放无聊列表中的数据信息
Object[][] object = null;
/**
* 默认构造函数
*/
public BookListFrame (){
super("图书管理"); //设置窗体名称
initComponents(); //调用实现窗口功能的函数
}
/**
* 设置窗口中各个标签,按钮,文本字段的大小,名称位置
* 连接按钮实现的功能
*/
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField(7);
jLabel2 = new javax.swing.JLabel();
jTextField2 = new javax.swing.JTextField(7);
jButton1 = new javax.swing.JButton();
jLabel3 = new javax.swing.JLabel();
jScrollPane1 = new javax.swing.JScrollPane();
jTable1 = new javax.swing.JTable();
jButton2 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
jButton4 = new javax.swing.JButton();
jButton5 = new javax.swing.JButton();
jButton6 = new javax.swing.JButton();
jButton7 = new javax.swing.JButton();
jButton8 = new javax.swing.JButton();
jButton9 = new javax.swing.JButton();
jLabel1.setText("书名");
jLabel2.setText("作者");
jLabel3.setVerticalAlignment(jLabel3.CENTER);
jLabel3.setText("图书管理");
jButton1.setText("查询");
jButton2.setText("插入");
jButton3.setText("修改");
jButton4.setText("导入");
jButton5.setText("导出");
jButton6.setText("显示所有");
jButton7.setText("删除");
jButton8.setText("关闭");
jButton9.setText("检索仓库类型");
jScrollPane1.setViewportView(jTable1);
/**
* 设置各标签,按钮在窗体的位置和大小
* 插入到窗体中
*/
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup
(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(layout.createParallelGroup
(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(23, 23, 23)
.add(layout.createParallelGroup
(org.jdesktop.layout.GroupLayout.TRAILING)
.add(jLabel3)
.add(layout.createSequentialGroup()
.add(jLabel1)
.addPreferredGap
(org.jdesktop.layout.LayoutStyle.UNRELATED)
.add(jTextField1,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(18, 18, 18)
.add(jLabel2)))
.add(18, 18, 18)
.add(jTextField2,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(18, 18, 18)
.add(jButton1))
.add(layout.createSequentialGroup()
.addContainerGap()
.add(jScrollPane1,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.add(layout.createSequentialGroup()
.addContainerGap()
.add(jButton2)
.add(18, 18, 18)
.add(jButton3)
.addPreferredGap
(org.jdesktop.layout.LayoutStyle.UNRELATED)
.add(jButton4)
.addPreferredGap
(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jButton5)
.addPreferredGap
(org.jdesktop.layout.LayoutStyle.UNRELATED)
.add(jButton6)
.addPreferredGap
(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jButton7)
.addPreferredGap
(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jButton9)
.addPreferredGap
(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jButton8)))
.addContainerGap(31, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup
(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(4, 4, 4)
.add(jLabel3)
.addPreferredGap
(org.jdesktop.layout.LayoutStyle.RELATED)
.add(layout.createParallelGroup
(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jTextField1,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(jTextField2,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(jLabel2)
.add(jLabel1)
.add(jButton1))
.addPreferredGap
(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jScrollPane1,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 203,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(20, 20, 20)
.add(layout.createParallelGroup
(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jButton2)
.add(jButton3)
.add(jButto
- 1
- 2
前往页