📄 win1.java
字号:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.BevelBorder;
import javax.swing.border.EmptyBorder;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.sql.SQLException;
import java.util.Vector;
import javax.swing.border.EtchedBorder;
import javax.swing.event.*;
import javax.swing.tree.*;
import java.io.*;
//import books.FileNode;
//import books.FileNode1;
//import books.IconData;
//import books.IconData1;
//import books.systemcontrol;
import com.swtdesigner.SwingResourceManager;
public class Win1 extends JFrame implements ActionListener, Runnable {
static Thread mainThread;
static String jd = "加载程序中,请稍候......";
static int per = 0;
private JTextArea textArea_9;
private JTextArea textArea_8;
private JTextArea textArea_1;
private JTextArea textArea_6;
private JTextArea textArea_5;
private JTextArea textArea_4;
private JTextField textField_3;
private JTextArea textArea_3;
private JTextArea textArea_2;
private JTextArea textArea;
private JTextField textField_1;
protected DefaultTreeModel model;
protected DefaultTreeModel model1;
private JTextField textField;
private JComboBox comboBox_9;
private JTextArea textAreagl;
private JComboBox comboBox_12;
private JComboBox comboBox_11;
private JComboBox comboBox_10;
private JComboBox comboBox_5;
private JComboBox comboBox_8;
private JComboBox comboBox_7;
private JComboBox comboBox_6;
private JComboBox comboBox_1;
String[] o;
String[] tj1;
int lv = 0;
int q = 0;
int q1 = 0;
int q2 = 0;
private JTextField textField_4gl;
private JTextField textField_3gl;
private JTextField textField_2gl;
private JTextField textFieldgl;
private JComboBox comboBox_4;
private JComboBox comboBox_3;
private JComboBox comboBox_2;
private JComboBox comboBox;
public static int pw = 0;
String path = "";
String path1 = "";
private JTextField textField_818;
private JTextField textField_717;
private JTextField textField_616;
private JTextField textField_515;
private JTextField textField_414;
private JTextField textField_313;
private JTextField textField_212;
private JTextField textField11;
private JTextField textField_726;
private JTextField textField_625;
private JTextField textField_524;
private JTextField textField_423;
private JTextField textField_322;
private JTextField textField_221;
private JTextArea textArea_333;
private JTextArea textArea_232;
private JTextArea textArea31;
private JTextField textField_343;
private JTextField textField_242;
private JTextField textField_252;
private JTextField textField51;
public static final ImageIcon ICON_COMPUTER = new ImageIcon("computer.JPG");
public static final ImageIcon ICON_DISK = new ImageIcon("disk.JPG");
public static final ImageIcon ICON_FOLDER = new ImageIcon("folder.JPG");
public static final ImageIcon ICON_EXPANDEDFOLDER = new ImageIcon(
"expandedfolder.JPG");
public static String lnfName = "com.sun.java.swing.plaf.windows.WindowsLookAndFeel";
protected JTree m_tree;
protected DefaultTreeModel m_model;
protected JTextField m_display;
private JTextField textField_262;
private JTree tree;
private JTextField textField61;
protected JTree n_tree;
protected DefaultTreeModel n_model;
protected JTextField n_display;
private JPasswordField passwordField_3;
private JPasswordField passwordField_2;
private JPasswordField passwordField1;
private JTextField textField71;
final JPanel index = new JPanel();
final JPanel 图书查询 = new JPanel();
final JPanel 图书流通 = new JPanel();
final JPanel 系统管理 = new JPanel();
final JPanel 帮助说明 = new JPanel();
private class SwingAction extends AbstractAction {
SwingAction(String e) {
super("New Action", null);
putValue(Action.SHORT_DESCRIPTION, e);
putValue(Action.LONG_DESCRIPTION, e);
}
public void actionPerformed(ActionEvent e) {
if (e.getActionCommand().equals("退出系统")) {
ConfirmWindow askWindow = new ConfirmWindow();
askWindow.setVisible(true);
}
// else
System.out.println("Error in Confirm Window.");
}
}
private SwingAction exit = new SwingAction("离开图书管理系统");
private SwingAction search = new SwingAction("查询图书、读者");
private SwingAction lt = new SwingAction("借书以及还书");
private SwingAction gl = new SwingAction("对系统进行管理");
private SwingAction bz = new SwingAction("帮助信息");
/**
* Launch the application
*
* @param args
*/
public static void main(String args[]) {
try {
// Win1.JWindowDemo splash = new Win1.JWindowDemo();
// start();
// splash.start();
Win1 fr = new Win1();
JWindowDemo w1 = fr.new JWindowDemo();
JWindowDemo1 w2 = fr.new JWindowDemo1();
w1.start();
w2.start();
} catch (Exception e) {
e.printStackTrace();
// System.out.print("数据库错误,请确认您的操作无误。");
}
}
/**
* Create the frame
*
* @throws SQLException
* @throws RemoteException
* @throws NotBoundException
* @throws MalformedURLException
*/
public Win1() throws RemoteException, SQLException, MalformedURLException,
NotBoundException {
super("G时代图书馆 V1.00正式版");
setIconImage(SwingResourceManager.getImage(Win1.class, "book.jpg"));
getContentPane().setLayout(null);
setResizable(false);
setBounds(150, 150, 724, 468);
per=1;
setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
addWindowListener(new InnerDestroyer());
getContentPane().setFont(new Font("宋体", Font.PLAIN, 40));
index.setFont(new Font("宋体", Font.PLAIN, 40));
Calculator c = (Calculator) Naming
.lookup("rmi://localhost/CalculatorService");
// 主界面哈
jd="正在载入主界面";
setLnf(lnfName);
index.setBounds(0, 0, 724, 468);
index.setBackground(new Color(0, 0, 0));
index.setPreferredSize(new Dimension(724, 468));
index.setMinimumSize(new Dimension(30, 30));
index.setMaximumSize(new Dimension(30, 30));
index.setLayout(null);
getContentPane().add(index);
per++;
JLabel LOGO = new JLabel();
LOGO.setBackground(new Color(255, 255, 255));
LOGO.setIcon(SwingResourceManager.getIcon(Win1.class, "logo.jpg"));
LOGO.setBounds(0, 0, 724, 444);
// final JPanel 按钮 = new JPanel();
// 按钮.setBackground(new Color(255, 255, 255));
// 按钮.setLayout(null);
// 按钮.setBounds(0, 357, 724, 80);
per++;
final JButton button = new JButton();
button.setBounds(42, 388, 100, 25);
index.add(button);
button.setFont(new Font("宋体", Font.PLAIN, 15));
button.setAction(search);
button.setText("图书查询");
per++;
final JButton button_1 = new JButton();
button_1.setAction(lt);
button_1.setText("图书流通");
button_1.setBounds(177, 388, 100, 25);
button_1.setFont(new Font("宋体", Font.PLAIN, 15));
index.add(button_1);
per++;
final JButton button_2 = new JButton();
button_2.setAction(gl);
button_2.setText("系统管理");
button_2.setBounds(312, 388, 100, 25);
button_2.setFont(new Font("宋体", Font.PLAIN, 15));
index.add(button_2);
per++;
final JButton button_3 = new JButton();
button_3.setAction(bz);
button_3.setText("帮助说明");
button_3.setBounds(447, 388, 100, 25);
button_3.setFont(new Font("宋体", Font.PLAIN, 15));
index.add(button_3);
per++;
final JButton button_4 = new JButton();
button_4.setAction(exit);
// final JLabel label_7 = new JLabel();
// label_7.setIcon(SwingResourceManager.getIcon(Win1.class, "book.jpg"));
// label_7.setText("New JLabel");
// label_7.setBounds(55, 23, 60, 15);
// 按钮.add(label_7);
button_4.setText("退出系统");
button_4.setFont(new Font("宋体", Font.PLAIN, 15));
button_4.setBounds(592, 388, 100, 25);
index.add(button_4);
// index.add(按钮);
index.add(LOGO);
per++;
图书查询.setBounds(0, 0, 724, 468);
图书查询.setLayout(null);
final JTabbedPane tabbedPane = new JTabbedPane();
tabbedPane.setBounds(10, 10, 684, 408);
per++;
jd="图书查询界面载入中……";
图书查询.add(tabbedPane);
final JPanel i1 = new JPanel();
i1.setLayout(null);
// 图书查询卡
tabbedPane.add(i1, "图书查询");
String[] c1 = { "书名", "作者名", "书号", "出版社", "关键字", "类别" };
String[] c3 = { "任意一致", "前方一致", "后方一致", "等于" };
String[] c2 = { "并且", "或者", "非" };
comboBox = new JComboBox(c1);
comboBox.setBounds(50, 45, 98, 21);
i1.add(comboBox);
per++;
comboBox_2 = new JComboBox(c1);
comboBox_2.setBounds(50, 101, 98, 21);
i1.add(comboBox_2);
per++;
comboBox_3 = new JComboBox(c1);
comboBox_3.setBounds(50, 163, 98, 21);
i1.add(comboBox_3);
comboBox_4 = new JComboBox(c1);
comboBox_4.setBounds(50, 221, 98, 21);
i1.add(comboBox_4);
per++;
textFieldgl = new JTextField();
textFieldgl.setBounds(183, 45, 146, 21);
i1.add(textFieldgl);
per++;
textField_2gl = new JTextField();
textField_2gl.setBounds(183, 101, 146, 21);
i1.add(textField_2gl);
textField_3gl = new JTextField();
textField_3gl.setBounds(183, 163, 146, 21);
i1.add(textField_3gl);
textField_4gl = new JTextField();
textField_4gl.setBounds(183, 221, 146, 21);
i1.add(textField_4gl);
per++;
comboBox_1 = new JComboBox(c2);
comboBox_1.setBounds(366, 45, 71, 21);
i1.add(comboBox_1);
per++;
comboBox_6 = new JComboBox(c2);
comboBox_6.setBounds(366, 101, 71, 21);
i1.add(comboBox_6);
comboBox_7 = new JComboBox(c2);
comboBox_7.setBounds(366, 163, 71, 21);
i1.add(comboBox_7);
comboBox_8 = new JComboBox(c2);
comboBox_8.setBounds(366, 221, 71, 21);
i1.add(comboBox_8);
per++;
comboBox_5 = new JComboBox(c3);
comboBox_5.setBounds(481, 45, 133, 21);
i1.add(comboBox_5);
comboBox_10 = new JComboBox(c3);
comboBox_10.setBounds(481, 101, 133, 21);
i1.add(comboBox_10);
per++;
comboBox_11 = new JComboBox(c3);
comboBox_11.setBounds(481, 163, 133, 21);
i1.add(comboBox_11);
comboBox_12 = new JComboBox(c3);
comboBox_12.setBounds(481, 221, 133, 21);
i1.add(comboBox_12);
per++;
final JButton buttongl = new JButton();
buttongl.setText("搜索");
buttongl.setBounds(49, 313, 99, 23);
i1.add(buttongl);
final JButton button_1gl = new JButton();
button_1gl.setText("清除");
button_1gl.setBounds(205, 313, 99, 23);
i1.add(button_1gl);
per++;
final JButton button_2gl = new JButton();
button_2gl.setText("返回主界面");
button_2gl.setBounds(366, 313, 99, 23);
i1.add(button_2gl);
final JButton button_3gl = new JButton();
button_3gl.setText("退出系统");
button_3gl.setBounds(515, 313, 99, 23);
i1.add(button_3gl);
final JPanel i2 = new JPanel();
i2.setLayout(null);
// 读者查询卡
tabbedPane.add(i2, "读者查询");
per++;
final JLabel label = new JLabel();
label.setBounds(69, 63, 60, 15);
label.setText("读者ID号");
i2.add(label);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -