资源简介
多年前用Java写的基于swing的图书管理系统。
代码片段和文件信息
package com.libraryms.function;
import java.awt.Container;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.beans.PropertyVetoException;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JInternalframe;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JSeparator;
import javax.swing.JTextField;
import javax.swing.event.InternalframeEvent;
import javax.swing.event.InternalframeListener;
import com.libraryms.main.Workframe;
import com.libraryms.model.Admin;
import com.libraryms.service.AdminService;
import com.libraryms.util.Point;
import com.libraryms.util.Validate;
public class AddAdmin extends JInternalframe implements InternalframeListener {
private static AddAdmin instance = null;
private static boolean isDisplay = false;
private JTextField txAdminNo;
private JTextField txAdminName;
private JTextField txPassword;
private JTextField txLicenseNo;
private JCheckBox cbBorrow;
private JCheckBox cbReturn;
private JCheckBox cbCount;
private JCheckBox cbReaderInf;
private JCheckBox cbReaderMag;
private JCheckBox cbBookInf;
private JCheckBox cbBookMag;
private JCheckBox cbDelete;
private JCheckBox cbAdminMag;
private JCheckBox cbSystenCfg;
private JCheckBox cbAdd;
private char[] licenseNo = new String(“00000000000“).toCharArray();
public static AddAdmin getInstance() {
if (!isDisplay) {
instance = new AddAdmin();
isDisplay = true;
return instance;
} else {
return null;
}
}
private AddAdmin() {
settitle(“添加管理员“);
Toolkit t = Toolkit.getDefaultToolkit();
int width = t.getScreenSize().width;
int height = t.getScreenSize().height;
setBounds(width / 2 - 285 (height - 163) / 2 - 130 570 360);
this.setClosable(true);
this.setMaximizable(false);
this.setVisible(true);
this.addInternalframeListener(this);
try {
this.setSelected(true);// 多个窗口重叠时,最后执行的命令弹出的窗口前置
} catch (PropertyVetoException e) {
e.printStackTrace();
}
Point ps[][] = new Point[10][4];// 计算得到各个控件的坐标
int startX = 25;
int startY = 35;
for (int i = 0; i < 10; i++) {
for (int j = 0; j < 4; j++) {
ps[i][j] = new Point();
if (j == 0) {
ps[i][j].x = startX;
} else if (j == 1) {
ps[i][j].x = startX + 45 + 35;
} else if (j == 2) {
ps[i][j].x = startX + 45 + 25 + 170 + 45;
} else if (j == 3) {
ps[i][j].x = startX + 45 + 45 + 170 + 45 + 45;
}
if (j % 2 == 0) {
ps[i][j].y = startY + 35 * i;// 间距为 25-15=10px
} else {
ps[i][j].y = startY + 35 * i - 7;
}
}
}
Container contentPane = getContentPane();
contentPane.setLayout(null);
JLabel lb1 = new JLabel(“管理员id“);
lb1.setBounds(ps[0][0].x ps[0][0].y 55 15);
contentPane.add(lb1);
txAdminNo = new JTextField();
txAdminNo.setEnabled(false);
txAdminNo.setBounds(ps[0][1
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1583 2012-02-09 09:25 LibraryManagerSystem\.classpath
文件 66 2010-02-04 10:45 LibraryManagerSystem\.myumldata
文件 396 2010-03-10 10:07 LibraryManagerSystem\.project
文件 1357 2012-02-09 09:25 LibraryManagerSystem\bin\com\libraryms\function\AddAdmin$1.class
文件 1235 2012-02-09 09:25 LibraryManagerSystem\bin\com\libraryms\function\AddAdmin$10.class
文件 1235 2012-02-09 09:25 LibraryManagerSystem\bin\com\libraryms\function\AddAdmin$11.class
文件 2416 2012-02-09 09:25 LibraryManagerSystem\bin\com\libraryms\function\AddAdmin$12.class
文件 826 2012-02-09 09:25 LibraryManagerSystem\bin\com\libraryms\function\AddAdmin$13.class
文件 1230 2012-02-09 09:25 LibraryManagerSystem\bin\com\libraryms\function\AddAdmin$2.class
文件 1230 2012-02-09 09:25 LibraryManagerSystem\bin\com\libraryms\function\AddAdmin$3.class
文件 1230 2012-02-09 09:25 LibraryManagerSystem\bin\com\libraryms\function\AddAdmin$4.class
文件 1230 2012-02-09 09:25 LibraryManagerSystem\bin\com\libraryms\function\AddAdmin$5.class
文件 1230 2012-02-09 09:25 LibraryManagerSystem\bin\com\libraryms\function\AddAdmin$6.class
文件 1232 2012-02-09 09:25 LibraryManagerSystem\bin\com\libraryms\function\AddAdmin$7.class
文件 1232 2012-02-09 09:25 LibraryManagerSystem\bin\com\libraryms\function\AddAdmin$8.class
文件 1233 2012-02-09 09:25 LibraryManagerSystem\bin\com\libraryms\function\AddAdmin$9.class
文件 8368 2012-02-09 09:25 LibraryManagerSystem\bin\com\libraryms\function\AddAdmin.class
文件 1071 2012-02-09 09:25 LibraryManagerSystem\bin\com\libraryms\function\AddBook$1.class
文件 775 2012-02-09 09:25 LibraryManagerSystem\bin\com\libraryms\function\AddBook$2.class
文件 775 2012-02-09 09:25 LibraryManagerSystem\bin\com\libraryms\function\AddBook$3.class
文件 6927 2012-02-09 09:25 LibraryManagerSystem\bin\com\libraryms\function\AddBook$4.class
文件 817 2012-02-09 09:25 LibraryManagerSystem\bin\com\libraryms\function\AddBook$5.class
文件 14682 2012-02-09 09:25 LibraryManagerSystem\bin\com\libraryms\function\AddBook.class
文件 2699 2012-02-09 09:25 LibraryManagerSystem\bin\com\libraryms\function\AddBookCategory$1.class
文件 871 2012-02-09 09:25 LibraryManagerSystem\bin\com\libraryms\function\AddBookCategory$2.class
文件 4577 2012-02-09 09:25 LibraryManagerSystem\bin\com\libraryms\function\AddBookCategory.class
文件 2577 2012-02-09 09:25 LibraryManagerSystem\bin\com\libraryms\function\AddClass$1.class
文件 822 2012-02-09 09:25 LibraryManagerSystem\bin\com\libraryms\function\AddClass$2.class
文件 5094 2012-02-09 09:25 LibraryManagerSystem\bin\com\libraryms\function\AddClass.class
文件 2241 2012-02-09 09:25 LibraryManagerSystem\bin\com\libraryms\function\AddDepartment$1.class
............此处省略446个文件信息
- 上一篇:使用echarts绘制android图表
- 下一篇:jsp 网上投票系统
评论
共有 条评论