资源简介
本人自己做了两个星期的数据课程设计。压缩包里含有商品管理系统java工程(Eclipse)、商品库存数据库7个基本表和1张记录表、一篇5000字的课程设计报告和一篇短小的说明。

代码片段和文件信息
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import javax.swing.JButton;
import javax.swing.Jframe;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JTextField;
public class ChangePassword extends Jframe implements ActionListener {
String name;// 登陆的用户名
JLabel label_1 = new JLabel(“修改密码“);
JLabel label_2 = new JLabel(“新 密 码:“);
JLabel label_3 = new JLabel(“密码确认:“);
JTextField textField_1 = new JTextField();
JTextField textField_2 = new JTextField();
JButton button_ok = new JButton(“确认“);
JButton button_cancel = new JButton(“取消“);
Font font_2 = new Font(“Monospaced“ Font.BOLD 19);
Connection conn;
Jframe frame;
public ChangePassword(String name) {
conn = new ConnectionDB().getConnection();
frame = new Jframe(“修改密码“);
frame.setIconImage(frame.getToolkit().getImage(“java.png“));
Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize();// 获取屏幕大小
int width = 400;// 窗口宽度
int height = 300;
frame.setLayout(null);
label_1.setBounds(140 20 120 50);
label_1.setFont(font_2);
label_2.setBounds(90 100 100 30);
label_3.setBounds(90 160 100 30);
textField_1.setBounds(160 100 150 30);
textField_2.setBounds(160 160 150 30);
button_ok.setBounds(80 230 80 30);
button_cancel.setBounds(240 230 80 30);
frame.add(label_1);
frame.add(label_2);
frame.add(label_3);
frame.add(textField_1);
frame.add(textField_2);
frame.add(button_ok);
button_ok.addActionListener(this);
frame.add(button_cancel);
button_cancel.addActionListener(this);
frame.setBounds((dimension.width - width) / 2 (dimension.height - height) / 2 width height);// 窗口居中
frame.setVisible(true);
frame.setResizable(false);
}
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
int i = 1;
if (e.getSource() == button_ok) {
String sql = null;
if (textField_1.getText().length() != 0 && textField_2.getText().length() != 0) {
if(textField_1.getText().trim().equals(textField_2.getText().trim())){
sql = “update 登陆 set 密码=‘“ + textField_1.getText() + “‘where 用户名=‘“ + name + “‘“;
}
else{
JOptionPane.showMessageDialog(null “两次密码不一样!!“ “警告“ JOptionPane.ERROR_MESSAGE);
return ;
}
} else {
JOptionPane.showMessageDialog(null “密码不能为空!“ “警告“ JOptionPane.ERROR_MESSAGE);
return ;
}
PreparedStatement pstmt;
try {
pstmt = (PreparedStatement) conn.prepareStatement(sql);
i = pstmt.executeUpdate();
pstmt.close();
// conn.close();
} catch (SQLException e3) {
e3.printStackTrace();
}
frame.dispose();
JOptionPane.showMessageDialog(null “密码修改成功!“ “提示“ JOptionPane.PLAIN_MESSAGE);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 412 2015-10-10 11:52 商品库存管理系统\InventoryManagement\.classpath
文件 395 2015-10-10 11:52 商品库存管理系统\InventoryManagement\.project
文件 598 2015-10-10 11:52 商品库存管理系统\InventoryManagement\.settings\org.eclipse.jdt.core.prefs
文件 33990 2015-10-10 11:52 商品库存管理系统\InventoryManagement\1.jpg
文件 1889334 2015-10-10 11:52 商品库存管理系统\InventoryManagement\11.bmp
文件 321991 2015-10-10 11:52 商品库存管理系统\InventoryManagement\11.png
文件 320323 2015-10-10 11:52 商品库存管理系统\InventoryManagement\22.png
文件 3961 2015-10-10 11:52 商品库存管理系统\InventoryManagement\bin\ChangePassword.class
文件 7631 2015-10-10 11:52 商品库存管理系统\InventoryManagement\bin\CommodityInfo.class
文件 1290 2015-10-10 11:52 商品库存管理系统\InventoryManagement\bin\ConnectionDB.class
文件 4566 2015-10-10 11:52 商品库存管理系统\InventoryManagement\bin\InventoryAndStorage.class
文件 8388 2015-10-10 11:52 商品库存管理系统\InventoryManagement\bin\InventoryInfo.class
文件 949 2015-10-10 11:52 商品库存管理系统\InventoryManagement\bin\LogIn$1.class
文件 6145 2015-10-10 11:52 商品库存管理系统\InventoryManagement\bin\LogIn.class
文件 27167 2015-10-10 11:52 商品库存管理系统\InventoryManagement\bin\LogIn.jpg
文件 1265 2015-10-10 11:52 商品库存管理系统\InventoryManagement\bin\Main.class
文件 4567 2015-10-10 11:52 商品库存管理系统\InventoryManagement\bin\MainShow.class
文件 5419 2015-10-10 11:52 商品库存管理系统\InventoryManagement\bin\MyEvent.class
文件 1630 2015-10-10 11:52 商品库存管理系统\InventoryManagement\bin\MyMenuPanel.class
文件 2597 2015-10-10 11:52 商品库存管理系统\InventoryManagement\bin\MyStatement.class
文件 9111 2015-10-10 11:52 商品库存管理系统\InventoryManagement\bin\PutInStorage.class
文件 8619 2015-10-10 11:52 商品库存管理系统\InventoryManagement\bin\PutOutStorage.class
文件 2222 2015-10-10 11:52 商品库存管理系统\InventoryManagement\bin\ShowTableData.class
文件 2530 2015-10-10 11:52 商品库存管理系统\InventoryManagement\bin\Statistics.class
文件 3941 2015-10-10 11:52 商品库存管理系统\InventoryManagement\bin\Statistics_commodity_info.class
文件 4049 2015-10-10 11:52 商品库存管理系统\InventoryManagement\bin\Statistics_in_storage.class
文件 4052 2015-10-10 11:52 商品库存管理系统\InventoryManagement\bin\Statistics_out_storage.class
文件 6537 2015-10-10 11:52 商品库存管理系统\InventoryManagement\bin\StoreInfo.class
文件 7170 2015-10-10 11:52 商品库存管理系统\InventoryManagement\bin\Supplier.class
文件 7288 2015-10-10 11:52 商品库存管理系统\InventoryManagement\bin\UserManagement.class
............此处省略39个文件信息
相关资源
- 美食天下项目Android版源码和Web版源码
- java代码编写将excel数据导入到mysql数据
- JAVA828436
- java 企业销售管理系统
- 基于JSP的学生宿舍管理系统(源码 数
- JSP学生信息管理系统 Mysql数据库
- android通过JDBC连接Mysql数据库
- java数据库连接(所有的数据库都支持
- 数据库设备管理系统课程设计论文J
- jsp与SQL Server数据库实现的客户注册登
- java sql2000员工管理系统数据库、文档
- java数据库版学生成绩管理系统
- java web学生管理系统(源码+数据库+截
- JavaWeb停车场管理系统(源代码,数据
- Java Web实现的易买网系统网站(源码
- 简单的登录页面,实现增删改查(运
- 物流管理系统源码(含数据库)5624
- jsp模拟酷狗官网源码(附数据库)
- 一个完整的点餐微信小程序(附后台
- 基于 struts 的学生寝室管理系统的设计
- 煤矿安全管理系统(jsp源码+数据库脚
- 基于JSP实现的美食餐饮管理系统(源
- 都市供求信息网(源码+数据库+文档)
- 图书管理系统(源码+数据库+截图)
- 学生信息管理系统源码+mysql数据库
- javaweb网上购物系统源码(附数据库脚
- jsp+servlet+jdbc开发学生信息后台管理系
- JSP选课系统(源码+文档+数据库)
- 基于JSP的超市销售管理系统(源码+
- jsp宠物商店(源码+数据库)
评论
共有 条评论