package com.feicui.frame;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.text.SimpleDateFormat;
import java.util.List;
import javax.swing.ButtonGroup;
import javax.swing.DefaultComboBoxModel;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFormattedTextField;
import javax.swing.JInternalFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
import javax.swing.table.DefaultTableModel;
import com.feicui.Start;
import com.feicui.dao.Dao;
import com.feicui.entity.ReaderInfo;
import com.feicui.util.MyDocument;
public class ReaderInfoChangeFrame extends JInternalFrame{
private JTable table;
private JTextField readername;
private JRadioButton boy;
private ButtonGroup buttonGroup=new ButtonGroup();
private JRadioButton JRadioButton2;
private JTextField age;
private JTextField zy;
private JComboBox comboBox;
private String[] columnNames={ "读者名称", "读者性别", "读者年龄", "证件号码", "会员证有效日期",
"最大借书量", "电话","押金","证件","职业","读者编号","读者办证时间" };
private String[] array=new String[]{"身份证","军人证","学生证","工作证"};
private JTextField zjnumber;
private JFormattedTextField bztime;
private JTextField maxnumber;
private JFormattedTextField date;
private JFormattedTextField tel;
private JTextField keepmoney;
private JTextField ISBN;
public ReaderInfoChangeFrame() {
setIconifiable(true);
setClosable(true);
setTitle("读者信息修改与删除");
setBounds(100, 100, 600, 420);
final JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
panel.setPreferredSize(new Dimension(400, 80));
getContentPane().add(panel, BorderLayout.NORTH);
final JLabel logoLabel = new JLabel();
ImageIcon readerModiAndDelIcon=new ImageIcon(Start.class.getResource("/readerModiAndDel.jpg"));
logoLabel.setIcon(readerModiAndDelIcon);
logoLabel.setBackground(Color.CYAN);
logoLabel.setOpaque(true);
logoLabel.setPreferredSize(new Dimension(400, 80));
panel.add(logoLabel);
logoLabel.setText("读者信息修改logo(400*80)");
final JPanel panel_1 = new JPanel();
panel_1.setLayout(new BorderLayout());
getContentPane().add(panel_1);
final JScrollPane scrollPane = new JScrollPane();
scrollPane.setPreferredSize(new Dimension(0, 100));
panel_1.add(scrollPane, BorderLayout.NORTH);
final DefaultTableModel model=new DefaultTableModel();
String[][]contents=getContents();
table = new JTable(contents,columnNames);
table.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
int selRow = table.getSelectedRow();
//id=table.getValueAt(selRow, 0).toString().trim();
readername.setText(table.getValueAt(selRow, 0).toString().trim());
if(table.getValueAt(selRow, 1).toString().trim().equals("男"))
boy.setSelected(true);
else
JRadioButton2.setSelected(true);
age.setText(table.getValueAt(selRow, 2).toString().trim());
zjnumber.setText(table.getValueAt(selRow, 3).toString().trim());
date.setText(table.getValueAt(selRow, 4).toString().trim());
maxnumber.setText(table.getValueAt(selRow, 5).toString().trim());
tel.setText(table.getValueAt(selRow, 6).toString().trim());
keepmoney.setText(table.getValueAt(selRow, 7).toString().trim());
comboBox.setSelectedItem(table.getValueAt(selRow, 8).toString().trim());
zy.setText(table.getValueAt(selRow, 9).toString().trim());
ISBN.setText(table.getValueAt(selRow, 10).toString().trim());
bztime.setText(table.getValueAt(selRow, 11).toString().trim());
}
});
scrollPane.setViewportView(table);
table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
final JPanel panel_2 = new JPanel();
final GridLayout gridLayout = new GridLayout(0, 4);
gridLayout.setVgap(9);
panel_2.setLayout(gridLayout);
panel_2.setPreferredSize(new Dimension(0, 200));
panel_1.add(panel_2, BorderLayout.SOUTH);
final JLabel label_1 = new JLabel();
label_1.setText(" 姓 名:");
panel_2.add(label_1);
readername = new JTextField();
readername.setDocument(new MyDocument(10));
panel_2.add(readername);
final JLabel label_2 = new JLabel();
label_2.setText(" 性 别:");
panel_2.add(label_2);
final JPanel panel_3 = new JPanel();
final FlowLayout flowLayout_1 = new FlowLayout();
flowLayout_1.setVgap(0);
panel_3.setLayout(flowLayout_1);
panel_2.add(panel_3);
boy = new JRadioButton();
boy.setSelected(true);
buttonGroup.add(boy);
panel_3.add(boy);
boy.setText("男");
JRadioButton2 = new JRadioButton();
buttonGroup.add(JRadioButton2);
panel_3.add(JRadioButton2);
JRadioButton2.setText("女");
final JLabel label_3 = new JLabel();
label_3.setText(" 年 龄:");
panel_2.add(label_3);
age = new JTextField();
age.setDocument(new MyDocument(2));
panel_2.add(age);
final JLabel label_5 = new JLabel();
label_5.setText(" 职 业:");
panel_2.add(label_5);
zy = new JTextField();
zy.setDocument(new MyDocument(30));
panel_2.add(zy);
final JLabel label = new JLabel();
label.setText(" 有效证件:");
panel_2.add(label);
comboBox = new JComboBox();
comboBox.setModel(new DefaultComboBoxModel(array));
for(int i=1;i<array.length;i++){
comboBox.setSelectedIndex(i);
comboBox.setSelectedItem(array);
}
panel_2.add(comboBox);
final JLabel label_6 = new JLabel();
label_6.setText(" 证件号码:");
panel_2.add(label_6);
zjnumber = new JTextField();
zjnumber.setDocument(new MyDocument(13));
panel_2.add(zjnumber);
final JLabel label_7 = new JLabel();
label_7.setText(" 办证日期:");
panel_2.add(label_7);
SimpleDateFormat myfmt=new SimpleDateFormat("yyyy-MM-dd");
bztime = new JFormattedTextField(myfmt.getDateInstance());
panel_2.add(bztime);
final JLabel label_9 = new JLabel();
label_9.setText(" 最大借书量:");
panel_2.add(label_9);
maxnumber = new JTextField();
panel_2.add(maxnumber);
final JLabel label_13 = new JLabel();
label_13.setText(" 会员证有效日期:");
panel_2.add(label_13);
date = new JFormattedTextField(myfmt.getDateInstance());
panel_2.add(date);
final JLabel label_8 = new JLabel();
label_8.setText(" 电 话:");
panel_2.add(label_8);
tel = new JFormattedTextField();
tel.setDocument(new MyDocument(11));
panel_2.add(tel);
final JLabel label_14 = new JLabel();
label_14.setText(" 押 金:");
panel_2.add(label_14);
keepmoney = new JTextField();
panel_2.add(keepmoney);
final JLabel label_4 = new JLabel();
label_4.setText(" 读者编号:");
panel_2.add(label_4);
ISBN = new JTextField();
ISBN.setEditable(false);
ISBN.setDocument(new MyDocument(13));
panel_2.add(ISBN);
final JPanel panel_4 = new JPanel();
panel_4.setMaximumSize(new Dimension(0, 0));
final FlowLayout flowLayout = new FlowLayout();
flowLayout.setVgap(0);
flowLayout.setHgap(4);
panel_4.setLayout(flowLayout);
panel_2.add(panel_4);
final JButton button = new JButton();
button.setHorizontalTextPosition(SwingConstants.CENTER);
panel_4.add(button);
button.setText("修改");
button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
// 姓名为空 提示
String name=readername.getText().trim();
if (na
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
JavaWeb经典项目-图书管理系统 源码下载 (138个子文件)
Dao.class 11KB
ReaderInfoChangeFrame.class 9KB
BookCheckedFrame.class 7KB
ReaderAddFrame.class 7KB
BookChangeFrame.class 6KB
BookOrderFrame.class 6KB
BookBorrowFrame.class 6KB
LibraryMainFrame.class 5KB
BookAddFrame.class 5KB
ReaderAddFrame$1.class 4KB
ReaderInfoChangeFrame$2.class 4KB
ReaderInfo.class 4KB
BookAddFrame$2.class 4KB
BookTypeAddFrame.class 3KB
BookBorrowFrame$2.class 3KB
LoginFrame.class 3KB
BookChangeFrame$2.class 3KB
BorrowInfo.class 3KB
BookInfo.class 3KB
BookOrderFrame$1.class 3KB
BookCheckedFrame$1.class 3KB
BookChangeFrame$1.class 2KB
MenuActions.class 2KB
Operator.class 2KB
ReaderInfoChangeFrame$1.class 2KB
BookOrder.class 2KB
BookOrderFrame$3.class 2KB
BookAddFrame$1.class 2KB
BookBorrowFrame$1.class 2KB
BookTypeAddFrame$1.class 2KB
LoginFrame$1.class 2KB
LoginFrame$2.class 2KB
LibraryMainFrame$1.class 2KB
BookCheckedFrame$2.class 2KB
MenuActions$NewBookOrder.class 1KB
MenuActions$NewBookCheck.class 1KB
BookBorrowFrame$4.class 1KB
MenuActions$ReaderInfoDel_Cha.class 1KB
MenuActions$BookBorrow.class 1KB
MenuActions$BookInfoChange.class 1KB
MenuActions$ReaderInfoAdd.class 1KB
MenuActions$BookTypeAdd.class 1KB
ReaderInfoChangeFrame$3.class 1KB
MenuActions$BookInfoAdd.class 1KB
BookBorrowFrame$3.class 1KB
BookBorrowFrame$TimeListener.class 1KB
LoginFrame$3.class 963B
MenuActions$ChangePassWord.class 941B
MenuActions$BookSearch.class 929B
MenuActions$BookReturn.class 929B
MyDocument.class 923B
MenuActions$BookTypeChange.class 920B
MenuActions$UserChangeAndDelete.class 905B
BookAddFrame$3.class 861B
MenuActions$UserAdd.class 860B
Start.class 809B
MenuActions$Exit.class 789B
BookTypeAddFrame$2.class 759B
BookChangeFrame$3.class 753B
BookOrderFrame$2.class 747B
ReaderAddFrame$2.class 747B
.classpath 417B
Thumbs.db 12KB
Thumbs.db 12KB
mysql-connector-java-3.1.12-bin.jar 436KB
ReaderInfoChangeFrame.java 11KB
Dao.java 11KB
MenuActions.java 10KB
BookBorrowFrame.java 9KB
ReaderAddFrame.java 9KB
BookAddFrame.java 8KB
BookCheckedFrame.java 8KB
BookChangeFrame.java 8KB
BookOrderFrame.java 7KB
LibraryMainFrame.java 7KB
LoginFrame.java 5KB
BookTypeAddFrame.java 4KB
ReaderInfo.java 3KB
BorrowInfo.java 2KB
BookInfo.java 2KB
Operator.java 2KB
BookOrder.java 1KB
MyDocument.java 803B
Start.java 437B
backImg.jpg 478KB
backImg.jpg 478KB
backImgg.jpg 339KB
backImgg.jpg 339KB
bookTypemodianddel.jpg 115KB
bookTypemodianddel.jpg 115KB
readerModiAndDel.jpg 74KB
readerModiAndDel.jpg 74KB
bookmodify.jpg 72KB
bookmodify.jpg 72KB
booktypemodify.jpg 68KB
booktypemodify.jpg 68KB
bookTypeAdd.jpg 68KB
bookTypeAdd.jpg 68KB
bookAdd.jpg 59KB
bookAdd.jpg 59KB
共 138 条
- 1
- 2
资源评论
- weixin_388538932018-01-10确定是web版?
- wanperfect2017-06-05请问没有SQL文件吗,MYSQL数据库没有找到,可以发一下吗?谢谢了。
- 我是小小c2018-05-24可以的,参考价值还是有的
- HaCkerDeath2018-08-11不是WEB版 不建议下载 浪费积分
- A3455603092019-01-15很好,谢谢分享,学习咯
杜军强
- 粉丝: 73
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功