?? frame1.java
字號(hào):
package 管理員界面;
import java.awt.BorderLayout;
import java.awt.Dimension;
import javax.swing.JFrame;
import javax.swing.JPanel;
import com.borland.jbcl.layout.XYLayout;
import com.borland.jbcl.layout.*;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JFormattedTextField;
import javax.swing.JOptionPane;
import javax.swing.JToolBar;
import javax.swing.JTextPane;
import javax.swing.JTabbedPane;
import javax.swing.JEditorPane;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JPopupMenu;
import javax.swing.JTextArea;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JButton;
import java.awt.Font;
import javax.swing.JRadioButton;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.*;
import javax.swing.ButtonGroup;
import java.awt.event.*;
public class Frame1 extends JFrame {
Connection conn;
JPanel contentPane;
XYLayout xYLayout1 = new XYLayout();
JTabbedPane jTabbedPane1 = new JTabbedPane();
JPanel jPanel1 = new JPanel();
JPanel jPanel2 = new JPanel();
JPanel jPanel3 = new JPanel();
JPanel jPanel4 = new JPanel();
JPanel jPanel5 = new JPanel();
JPanel jPanel6 = new JPanel();
JPanel jPanel7 = new JPanel();
JPanel jPanel8 = new JPanel();
JLabel jLabel1 = new JLabel();
XYLayout xYLayout2 = new XYLayout();
JTextField jTextField1 = new JTextField();
JLabel jLabel2 = new JLabel();
JLabel jLabel3 = new JLabel();
JLabel jLabel4 = new JLabel();
JTextField jTextField2 = new JTextField();
JTextField jTextField3 = new JTextField();
JTextField jTextField4 = new JTextField();
JButton jButton1 = new JButton();
JLabel jLabel5 = new JLabel();
JLabel jLabel6 = new JLabel();
XYLayout xYLayout3 = new XYLayout();
JLabel jLabel7 = new JLabel();
JTextField jTextField5 = new JTextField();
JButton jButton2 = new JButton();
JTextArea jTextArea1 = new JTextArea();
JButton jButton3 = new JButton();
XYLayout xYLayout4 = new XYLayout();
JLabel jLabel8 = new JLabel();
JLabel jLabel9 = new JLabel();
JLabel jLabel10 = new JLabel();
JLabel jLabel11 = new JLabel();
JLabel jLabel12 = new JLabel();
JLabel jLabel13 = new JLabel();
JTextField jTextField6 = new JTextField();
JTextField jTextField7 = new JTextField();
JTextField jTextField8 = new JTextField();
JTextField jTextField9 = new JTextField();
JButton jButton4 = new JButton();
XYLayout xYLayout5 = new XYLayout();
JLabel jLabel14 = new JLabel();
JLabel jLabel15 = new JLabel();
JTextField jTextField10 = new JTextField();
JTextArea jTextArea2 = new JTextArea();
JButton jButton5 = new JButton();
JButton jButton6 = new JButton();
XYLayout xYLayout6 = new XYLayout();
JLabel jLabel16 = new JLabel();
JLabel jLabel17 = new JLabel();
JLabel jLabel18 = new JLabel();
JLabel jLabel19 = new JLabel();
JButton jButton7 = new JButton();
JButton jButton8 = new JButton();
JButton jButton9 = new JButton();
XYLayout xYLayout7 = new XYLayout();
JLabel jLabel20 = new JLabel();
JLabel jLabel21 = new JLabel();
JLabel jLabel22 = new JLabel();
JLabel jLabel23 = new JLabel();
JButton jButton10 = new JButton();
JButton jButton11 = new JButton();
JButton jButton12 = new JButton();
XYLayout xYLayout8 = new XYLayout();
JLabel jLabel24 = new JLabel();
JScrollPane jScrollPane1 = new JScrollPane();
JRadioButton jRadioButton1 = new JRadioButton();
JRadioButton jRadioButton2 = new JRadioButton();
JRadioButton jRadioButton3 = new JRadioButton();
JRadioButton jRadioButton4 = new JRadioButton();
JButton jButton13 = new JButton();
JTextArea jTextArea3 = new JTextArea();
XYLayout xYLayout9 = new XYLayout();
JLabel jLabel25 = new JLabel();
JScrollPane jScrollPane2 = new JScrollPane();
JTextArea jTextArea4 = new JTextArea();
JRadioButton jRadioButton5 = new JRadioButton();
JRadioButton jRadioButton6 = new JRadioButton();
JRadioButton jRadioButton7 = new JRadioButton();
JRadioButton jRadioButton8 = new JRadioButton();
JButton jButton14 = new JButton();
ButtonGroup buttonGroup1 = new ButtonGroup();
ButtonGroup bg=new ButtonGroup();
JButton jButton15 = new JButton();
ButtonGroup buttonGroup2 = new ButtonGroup();
JButton jButton16 = new JButton();
public Frame1() {
try {
setDefaultCloseOperation(EXIT_ON_CLOSE);
jbInit();
} catch (Exception exception) {
exception.printStackTrace();
}
}
private void jbInit() throws Exception {
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String connURL ="jdbc:odbc:library";
String user = "sa";
String pw = "123";
conn=DriverManager.getConnection(connURL,user,pw);
}
catch(Exception e)
{
System.out.println("class no found can not connect to sql server"+e);
}
this.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
closeWindow(e);
}
});
contentPane = (JPanel) getContentPane();
contentPane.setLayout(xYLayout1);
setSize(new Dimension(500, 480));
setTitle("圖書館管理員管理界面");
jLabel1.setText("ID");
jPanel1.setLayout(xYLayout2);
jLabel2.setText("姓名");
jLabel3.setText("宿舍");
jLabel4.setText("密碼");
jButton1.setText("確定");
jButton1.addActionListener(new Frame1_jButton1_actionAdapter(this));
jLabel5.setFont(new java.awt.Font("黑體", Font.PLAIN, 20));
jLabel5.setText("請(qǐng)?zhí)顚懻_的讀者信息");
jLabel6.setFont(new java.awt.Font("黑體", Font.PLAIN, 25));
jLabel6.setText("圖書館管理員管理界面");
jPanel2.setLayout(xYLayout3);
jLabel7.setText("刪除ID");
jButton2.setText("確認(rèn)信息");
jButton2.addActionListener(new Frame1_jButton2_actionAdapter(this));
jButton3.setText("確認(rèn)刪除");
jButton3.addActionListener(new Frame1_jButton3_actionAdapter(this));
jPanel3.setLayout(xYLayout4);
jLabel8.setFont(new java.awt.Font("黑體", Font.PLAIN, 20));
jLabel8.setText("請(qǐng)輸入所要?jiǎng)h除的讀者ID");
jLabel9.setFont(new java.awt.Font("黑體", Font.PLAIN, 20));
jLabel9.setText("請(qǐng)輸入正確的書籍信息");
jLabel10.setText("編號(hào)");
jLabel11.setText("書名");
jLabel12.setText("作者");
jLabel13.setText("出版社");
jButton4.setText("確定");
jButton4.addActionListener(new Frame1_jButton4_actionAdapter(this));
jPanel4.setLayout(xYLayout5);
jLabel14.setFont(new java.awt.Font("黑體", Font.PLAIN, 20));
jLabel14.setText("請(qǐng)輸入要?jiǎng)h除的書籍");
jPanel4.setFont(new java.awt.Font("黑體", Font.PLAIN, 20));
jLabel15.setText("輸入書籍編號(hào)");
jButton5.setText("確認(rèn)信息");
jButton5.addActionListener(new Frame1_jButton5_actionAdapter(this));
jButton6.setText("確認(rèn)刪除");
jButton6.addActionListener(new Frame1_jButton6_actionAdapter(this));
jPanel5.setLayout(xYLayout6);
jLabel16.setFont(new java.awt.Font("黑體", Font.PLAIN, 20));
jLabel16.setText("每天固定在三段時(shí)間收書");
jLabel17.setFont(new java.awt.Font("黑體", Font.PLAIN, 15));
jLabel17.setText("書籍編號(hào)為A--H----(早上10點(diǎn))");
jLabel18.setFont(new java.awt.Font("宋體", Font.PLAIN, 15));
jLabel18.setText("書籍編號(hào)為I--Q----(下午3點(diǎn))");
jLabel19.setFont(new java.awt.Font("宋體", Font.PLAIN, 15));
jLabel19.setText("書籍編號(hào)為R--Z----(晚上8點(diǎn))");
jButton7.setText("確定收書");
jButton7.addActionListener(new Frame1_jButton7_actionAdapter(this));
jButton8.setText("確定收書");
jButton8.addActionListener(new Frame1_jButton8_actionAdapter(this));
jButton9.setText("確定收書");
jButton9.addActionListener(new Frame1_jButton9_actionAdapter(this));
jPanel6.setLayout(xYLayout7);
jLabel20.setFont(new java.awt.Font("黑體", Font.PLAIN, 20));
jLabel20.setText("每天固定在三段時(shí)間送書");
jLabel21.setFont(new java.awt.Font("宋體", Font.PLAIN, 15));
jLabel21.setText("書籍編號(hào)為A--H----(早上10點(diǎn))");
jLabel22.setFont(new java.awt.Font("宋體", Font.PLAIN, 15));
jLabel22.setText("書籍編號(hào)為A--H----(下午3點(diǎn))");
jLabel23.setFont(new java.awt.Font("宋體", Font.PLAIN, 15));
jLabel23.setToolTipText("");
jLabel23.setText("書籍編號(hào)為A--H----(晚上8點(diǎn))");
jPanel6.setFont(new java.awt.Font("宋體", Font.PLAIN, 15));
jButton10.setText("確定送書");
jButton10.addActionListener(new Frame1_jButton10_actionAdapter(this));
jButton11.setText("確定送書");
jButton11.addActionListener(new Frame1_jButton11_actionAdapter(this));
jButton12.setText("確定送書");
jButton12.addActionListener(new Frame1_jButton12_actionAdapter(this));
jPanel7.setLayout(xYLayout8);
jLabel24.setFont(new java.awt.Font("黑體", Font.PLAIN, 20));
jLabel24.setText("查看所有的書籍信息");
jRadioButton1.setText("按書名");
jRadioButton1.addActionListener(new Frame1_jRadioButton1_actionAdapter(this));
jRadioButton2.setText("按作者");
jRadioButton3.setText("按出版社");
jRadioButton4.setText("書籍統(tǒng)計(jì)");
jButton13.setText("查看");
jButton13.addActionListener(new Frame1_jButton13_actionAdapter(this));
jTextArea3.setToolTipText("");
jPanel8.setLayout(xYLayout9);
jLabel25.setFont(new java.awt.Font("黑體", Font.PLAIN, 20));
jLabel25.setText("查看所有的讀者信息");
jRadioButton5.setText("按ID");
jRadioButton6.setText("按姓名");
jRadioButton7.setText("按宿舍");
jRadioButton8.setText("讀者統(tǒng)計(jì)");
jButton14.setText("查看");
jButton14.addActionListener(new Frame1_jButton14_actionAdapter(this));
jButton15.setText("清空");
jButton15.addActionListener(new Frame1_jButton15_actionAdapter(this));
jButton16.setText("清空");
jButton16.addActionListener(new Frame1_jButton16_actionAdapter(this));
jTabbedPane1.add(jPanel1, "增加ID");
jTabbedPane1.add(jPanel2, "刪除ID");
jTabbedPane1.add(jPanel3, "增加書籍");
jPanel3.add(jLabel9, new XYConstraints(121, 28, -1, -1));
jPanel3.add(jLabel10, new XYConstraints(36, 78, -1, -1));
jTabbedPane1.add(jPanel4, "刪除書籍");
jPanel4.add(jLabel14, new XYConstraints(130, 31, -1, -1));
jPanel5.add(jLabel16, new XYConstraints(104, 26, -1, -1));
jPanel5.add(jLabel17, new XYConstraints(16, 92, -1, -1));
jPanel5.add(jButton9, new XYConstraints(334, 250, -1, -1));
jPanel5.add(jButton7, new XYConstraints(334, 92, -1, -1));
jPanel5.add(jLabel18, new XYConstraints(16, 169, -1, -1));
jPanel5.add(jLabel19, new XYConstraints(15, 250, -1, -1));
jPanel5.add(jButton8, new XYConstraints(334, 168, -1, -1));
jPanel6.add(jLabel21, new XYConstraints(16, 91, -1, -1));
jPanel6.add(jButton10, new XYConstraints(325, 91, -1, -1));
jPanel6.add(jButton11, new XYConstraints(324, 167, -1, -1));
jPanel6.add(jButton12, new XYConstraints(323, 240, -1, -1));
jPanel6.add(jLabel23, new XYConstraints(13, 244, -1, -1));
jPanel6.add(jLabel22, new XYConstraints(14, 166, -1, -1));
jPanel6.add(jLabel20, new XYConstraints(104, 27, -1, -1));
contentPane.add(jLabel6, new XYConstraints(113, 8, 268, 28));
jTabbedPane1.add(jPanel7, "查看書籍");
jPanel7.add(jLabel24, new XYConstraints(123, 36, -1, -1));
jTabbedPane1.add(jPanel8, "查看讀者");
jPanel8.add(jLabel25, new XYConstraints(126, 41, -1, -1));
jPanel1.add(jLabel5, new XYConstraints(95, 17, -1, -1));
jPanel2.add(jLabel7, new XYConstraints(13, 67, -1, -1));
jPanel2.add(jLabel8, new XYConstraints(106, 13, -1, -1));
jPanel2.add(jButton3, new XYConstraints(324, 250, 83, 77));
jPanel2.add(jButton2, new XYConstraints(323, 58, 84, 30));
jPanel3.add(jLabel11, new XYConstraints(34, 135, -1, -1));
jPanel3.add(jTextField6, new XYConstraints(101, 70, 220, 44));
jPanel3.add(jTextField8, new XYConstraints(101, 187, 220, 44));
jPanel3.add(jLabel12, new XYConstraints(35, 202, -1, -1));
jPanel3.add(jButton4, new XYConstraints(350, 252, 77, 66));
jPanel3.add(jTextField7, new XYConstraints(101, 127, 220, 44));
jPanel3.add(jTextField9, new XYConstraints(102, 249, 220, 44));
jPanel3.add(jLabel13, new XYConstraints(32, 264, -1, -1));
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -