📄 userinterface.java
字号:
/*
* UserInterface.java
*
* Created on 2007年12月4日, 上午10:12
*/
package libAdmin;
import java.util.Vector;
import javax.swing.JComboBox;
import javax.swing.JOptionPane;
import java.sql.*;
import javax.swing.JTable;
import javax.swing.table.AbstractTableModel;
/**
*
* @author yu
*/
public class UserInterface extends javax.swing.JFrame {
Connection con;
String JDriver;
String conURL;
String userid;
/** Creates new form UserInterface */
public UserInterface(String userID) {
initComponents();
this.userid=userID;
}
public void connect() {
JDriver = "sun.jdbc.odbc.JdbcOdbcDriver";
conURL= "jdbc:odbc:pejuwe";
try {
Class.forName(JDriver);
} catch (ClassNotFoundException e) {
System.out.println("forname:" + e.getMessage());
}
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc=" 生成的代码 ">//GEN-BEGIN:initComponents
private void initComponents() {
jTabbedPane1 = new javax.swing.JTabbedPane();
queryPanel = new javax.swing.JPanel();
jLabel3 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jComboBox1 = new javax.swing.JComboBox();
jLabel4 = new javax.swing.JLabel();
jComboBox2 = new javax.swing.JComboBox();
jTextField1 = new javax.swing.JTextField();
jComboBox3 = new javax.swing.JComboBox();
jScrollPane1 = new javax.swing.JScrollPane();
jTable1 = new javax.swing.JTable();
readerInfoPanel = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
jScrollPane2 = new javax.swing.JScrollPane();
jTable3 = new javax.swing.JTable();
jTextField2 = new javax.swing.JTextField();
jTextField3 = new javax.swing.JTextField();
jTextField4 = new javax.swing.JTextField();
jMenuBar1 = new javax.swing.JMenuBar();
jMenu1 = new javax.swing.JMenu();
jMenu2 = new javax.swing.JMenu();
helpMenu = new javax.swing.JMenu();
help = new javax.swing.JMenuItem();
about = new javax.swing.JMenuItem();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setResizable(false);
jTabbedPane1.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jTabbedPane1MouseClicked(evt);
}
});
jLabel3.setText("\u68c0\u7d22\u5173\u952e\u8bcd\uff1a");
jLabel2.setText("\u68c0\u7d22\u9014\u5f84\uff1a");
jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "BookName", "PublishCompany", "ISBN", "CategoryID" }));
jComboBox1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jComboBox1ActionPerformed(evt);
}
});
jLabel4.setText("\u68c0\u7d22\u6a21\u5f0f\uff1a");
jComboBox2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "\u524d\u65b9\u4e00\u81f4", "\u7cbe\u786e\u914d\u7f6e" }));
jTextField1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTextField1ActionPerformed(evt);
}
});
jComboBox3.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "\u524d\u65b9\u4e00\u81f4", "\u7cbe\u786e\u914d\u7f6e" }));
jScrollPane1.setEnabled(false);
jTable1.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"书名", "作者", "出版社", "ISBN"
}
) {
Class[] types = new Class [] {
java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class
};
boolean[] canEdit = new boolean [] {
false, false, false, false
};
public Class getColumnClass(int columnIndex) {
return types [columnIndex];
}
public boolean isCellEditable(int rowIndex, int columnIndex) {
return canEdit [columnIndex];
}
});
jTable1.addAncestorListener(new javax.swing.event.AncestorListener() {
public void ancestorMoved(javax.swing.event.AncestorEvent evt) {
}
public void ancestorAdded(javax.swing.event.AncestorEvent evt) {
jTable1AncestorAdded(evt);
}
public void ancestorRemoved(javax.swing.event.AncestorEvent evt) {
}
});
jScrollPane1.setViewportView(jTable1);
org.jdesktop.layout.GroupLayout queryPanelLayout = new org.jdesktop.layout.GroupLayout(queryPanel);
queryPanel.setLayout(queryPanelLayout);
queryPanelLayout.setHorizontalGroup(
queryPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(queryPanelLayout.createSequentialGroup()
.add(22, 22, 22)
.add(queryPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING, queryPanelLayout.createSequentialGroup()
.add(jLabel3)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED))
.add(queryPanelLayout.createSequentialGroup()
.add(jLabel2)
.add(16, 16, 16)))
.add(queryPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
.add(queryPanelLayout.createSequentialGroup()
.add(jComboBox1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 117, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(jLabel4)
.add(19, 19, 19)
.add(jComboBox3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.add(jTextField1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 311, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.add(1219, 1219, 1219)
.add(jComboBox2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.add(queryPanelLayout.createSequentialGroup()
.addContainerGap()
.add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 704, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
);
queryPanelLayout.setVerticalGroup(
queryPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING, queryPanelLayout.createSequentialGroup()
.add(queryPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(queryPanelLayout.createSequentialGroup()
.addContainerGap(58, Short.MAX_VALUE)
.add(jComboBox2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(22, 22, 22))
.add(queryPanelLayout.createSequentialGroup()
.add(32, 32, 32)
.add(queryPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
.add(queryPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jComboBox3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(jLabel4))
.add(queryPanelLayout.createSequentialGroup()
.add(queryPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel2)
.add(jComboBox1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(queryPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel3)
.add(jTextField1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 312, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(58, 58, 58))
);
jTabbedPane1.addTab("\u67e5\u8be2\u56fe\u4e66", queryPanel);
jLabel1.setFont(new java.awt.Font("宋体", 0, 18));
jLabel1.setText("\u6b22\u8fce");
jLabel5.setText("\u7528\u6237\u540d");
jLabel6.setText("\u6765\u5230\u56fe\u4e66\u7ba1\u7406\u7cfb\u7edf");
jLabel7.setText("\u5f53\u524d\u501f\u9605\u60c5\u51b5\uff1a");
jLabel8.setText("\u501f\u4e66\u5361\u53f7\uff1a");
jLabel9.setText("\u5355\u4f4d\uff1a");
jScrollPane2.setEnabled(false);
jTable3.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null, null, null},
{null, null, null, null, null, null},
{null, null, null, null, null, null},
{null, null, null, null, null, null},
{null, null, null, null, null, null},
{null, null, null, null, null, null},
{null, null, null, null, null, null},
{null, null, null, null, null, null},
{null, null, null, null, null, null},
{null, null, null, null, null, null},
{null, null, null, null, null, null},
{null, null, null, null, null, null},
{null, null, null, null, null, null},
{null, null, null, null, null, null},
{null, null, null, null, null, null},
{null, null, null, null, null, null},
{null, null, null, null, null, null}
},
new String [] {
"书名", "作者", "出版社", "ISBN", "借出时间", "超期天数"
}
) {
Class[] types = new Class [] {
java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.Integer.class
};
boolean[] canEdit = new boolean [] {
false, false, false, false, false, false
};
public Class getColumnClass(int columnIndex) {
return types [columnIndex];
}
public boolean isCellEditable(int rowIndex, int columnIndex) {
return canEdit [columnIndex];
}
});
jScrollPane2.setViewportView(jTable3);
jTextField2.setText("jTextField2");
jTextField3.setText("jTextField3");
jTextField4.setText("jTextField4");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -