/*
* ProductBuyInterFrm.java
*
* Created on __DATE__, __TIME__
*/
package com.view;
import java.sql.Connection;
import java.sql.ResultSet;
import java.util.Vector;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
import com.dao.ProductChosenDao;
import com.dao.ProductDao;
import com.dao.ProductTypeDao;
import com.model.Product;
import com.model.ProductType;
import com.util.Dbutil;
import com.util.StringUtil;
/**
*
* @author __USER__
*/
public class ProductBuyInterFrm extends javax.swing.JInternalFrame {
Dbutil dbutil = new Dbutil();
ProductDao productDao = new ProductDao();
ProductTypeDao productTypeDao = new ProductTypeDao();
ProductChosenDao productChosenDao = new ProductChosenDao();
/** Creates new form ProductBuyInterFrm */
public ProductBuyInterFrm() {
initComponents();
this.setLocation(200, 20);
this.fillTable(new Product());
this.fillChosenTable();
this.fillProductType("search");
this.fillProductType("putInto");
}
private void fillProductType(String type) {
Connection con = null;
ProductType productType = null;
try {
con = dbutil.getCon();
ResultSet rs = productTypeDao.productTypeList(con,
new ProductType());
if ("search".equals(type)) {
productType = new ProductType();
productType.setProductTypeName("请选择....");
productType.setId(-1);
this.s_jcbProductType.addItem(productType);
}
while (rs.next()) {
productType = new ProductType();
productType.setId(rs.getInt("id"));
productType.setProductTypeName(rs.getString("productTypeName"));
if ("search".equals(type)) {
this.s_jcbProductType.addItem(productType);
} else if ("putInto".equals(type)) {
this.jcb_productType.addItem(productType);
}
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
} finally {
try {
dbutil.closeCon(con);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
private void fillTable(Product product) {
DefaultTableModel dtm = (DefaultTableModel) productTable.getModel();
dtm.setRowCount(0);//要把前面的数据释放掉
Connection con = null;
try {
con = dbutil.getCon();
ResultSet rs = productDao.productList(con, product);
while (rs.next()) {
Vector v = new Vector();
v.add(rs.getInt("id"));
v.add(rs.getString("productName"));
v.add(rs.getString("productTime"));
v.add(rs.getFloat("price"));
v.add(rs.getString("productDesc"));
v.add(rs.getString("productTypeName"));
dtm.addRow(v);
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
} finally {
try {
dbutil.closeCon(con);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
private void fillChosenTable() {
DefaultTableModel dtm = (DefaultTableModel) ProductChosenTable
.getModel();
dtm.setRowCount(0);//要把前面的数据释放掉
Connection con = null;
try {
con = dbutil.getCon();
ResultSet rs = productDao.productChosenList(con);
while (rs.next()) {
Vector v = new Vector();
v.add(rs.getInt("id"));
v.add(rs.getString("productName"));
v.add(rs.getString("productTime"));
v.add(rs.getFloat("price"));
v.add(rs.getString("productDesc"));
v.add(rs.getString("productTypeName"));
dtm.addRow(v);
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
} finally {
try {
dbutil.closeCon(con);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
//GEN-BEGIN:initComponents
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
jDialog1 = new javax.swing.JDialog();
jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
s_productNameTxt = new javax.swing.JTextField();
jLabel2 = new javax.swing.JLabel();
s_productTimeTxt = new javax.swing.JTextField();
jLabel3 = new javax.swing.JLabel();
s_jcbProductType = new javax.swing.JComboBox();
jb_search = new javax.swing.JButton();
jScrollPane1 = new javax.swing.JScrollPane();
productTable = new javax.swing.JTable();
jPanel2 = new javax.swing.JPanel();
jScrollPane3 = new javax.swing.JScrollPane();
ProductChosenTable = new javax.swing.JTable();
jb_delete = new javax.swing.JButton();
jb_cost = new javax.swing.JButton();
jb_putProductIntoCar = new javax.swing.JButton();
jScrollPane2 = new javax.swing.JScrollPane();
productDescTxt = new javax.swing.JTextArea();
jLabel9 = new javax.swing.JLabel();
jcb_productType = new javax.swing.JComboBox();
jLabel8 = new javax.swing.JLabel();
productTimeTxt = new javax.swing.JTextField();
jLabel7 = new javax.swing.JLabel();
priceTxt = new javax.swing.JTextField();
jLabel6 = new javax.swing.JLabel();
productNameTxt = new javax.swing.JTextField();
jLabel5 = new javax.swing.JLabel();
idTxt = new javax.swing.JTextField();
jLabel4 = new javax.swing.JLabel();
javax.swing.GroupLayout jDialog1Layout = new javax.swing.GroupLayout(jDialog1.getContentPane());
jDialog1.getContentPane().setLayout(jDialog1Layout);
jDialog1Layout.setHorizontalGroup(
jDialog1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 400, Short.MAX_VALUE)
);
jDialog1Layout.setVerticalGroup(
jDialog1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 300, Short.MAX_VALUE)
);
setClosable(true);
setIconifiable(true);
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("\u6311\u9009\u5546\u54c1"));
jLabel1.setText("\u5546\u54c1\u540d\u79f0");
jLabel2.setText("\u751f\u4ea7\u65e5\u671f");
jLabel3.setText("\u5546\u54c1\u7c7b\u522b");
jb_search.setIcon(new javax.swing.ImageIcon("./images\\search.png")); // NOI18N
jb_search.setText("\u67e5\u8be2");
jb_search.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jb_searchActionPerformed(evt);
}
});
productTable.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
},
new String [] {
"编号", "商品名称", "生产日期", "商品价格", "商品描述", "商品类别"
}
) {
boolean[] canEdit = new boolean [] {
false, false, false, false, false, false
};
public boolean isCellEditable(int rowIndex, int columnIndex) {
return canEdit [columnIndex];
}
});
productTable.addMouseListener(new java.awt.event.MouseAdapter() {
public void mousePressed(java.awt.event.MouseEvent evt) {
productTableMousePressed(evt);
}
});
jScrollPane1.setViewportView(productTable);
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(20, 20, 20)
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(s_productNameTxt, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(s_productTimeTxt, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jLabel3)
.addGap(18, 18, 18)
.addComponent(s_jcbProductType, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 166, Short.MAX_VALUE)
.addComponent(jb_search)
.addGap(38, 38, 38))
.addComponent(jScrollPa
没有合适的资源?快使用搜索试试~ 我知道了~
java swing精品项目源码第8期:购物系统项目(文档+视频+源码).zip
共168个文件
class:72个
png:26个
java:23个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 1 下载量 3 浏览量
2022-04-29
22:53:03
上传
评论 1
收藏 80.94MB ZIP 举报
温馨提示
【程序老媛出品,必属精品,亲测校正,质量保证】 资源名:java swing精品项目源码第8期:购物系统项目(文档+视频+源码).zip 资源类型:毕业设计项目源码+论文 源码说明: 全部项目源码都是经过测试校正后百分百成功运行的,如果您下载后不能运行可联系我进行指导或者更换。 适合人群:新手及有一定经验的开发人员
资源推荐
资源详情
资源评论
收起资源包目录
java swing精品项目源码第8期:购物系统项目(文档+视频+源码).zip (168个子文件)
java Swing mysql实现简单的购物系统项目源码.avi 83.21MB
main.c 70KB
ProductBuyInterFrm.class 18KB
ProductManageInterFrm.class 16KB
ProductTypeManageInterFrm.class 12KB
ProductAddInterFrm.class 9KB
CustomerLogOnFrm.class 8KB
ManagerLogOnFrm.class 8KB
CustomerAddInterFrm.class 7KB
CustomerLogOnInterFrm.class 7KB
ProductTypeInterFrm.class 6KB
MainFrm.class 6KB
ViewMainFrm.class 5KB
ProductDao.class 4KB
FuntionMainFrm.class 4KB
ProductChosenDao.class 3KB
ProductTypeDao.class 3KB
Product.class 2KB
Customer.class 2KB
CustomerUserDao.class 2KB
Dbutil.class 2KB
ManagerUserDao.class 1KB
ProductType.class 1KB
ManagerUser.class 1KB
ProductManageInterFrm$4.class 1014B
ProductManageInterFrm$3.class 1014B
CustomerLogOnInterFrm$1.class 1014B
ProductTypeManageInterFrm$2.class 939B
ProductManageInterFrm$1.class 916B
ProductBuyInterFrm$4.class 898B
ProductBuyInterFrm$2.class 898B
ProductTypeManageInterFrm$1.class 856B
ProductTypeManageInterFrm$4.class 856B
ProductTypeManageInterFrm$5.class 856B
ProductManageInterFrm$5.class 828B
CustomerLogOnInterFrm$2.class 828B
ProductManageInterFrm$7.class 828B
CustomerLogOnInterFrm$3.class 828B
ProductManageInterFrm$6.class 828B
ProductTypeManageInterFrm$3.class 824B
ProductTypeInterFrm$2.class 814B
CustomerAddInterFrm$1.class 814B
ProductTypeInterFrm$1.class 814B
ProductBuyInterFrm$7.class 807B
ProductAddInterFrm$1.class 807B
ProductBuyInterFrm$1.class 807B
ProductBuyInterFrm$8.class 807B
ProductAddInterFrm$2.class 807B
ProductBuyInterFrm$6.class 807B
ProductManageInterFrm$2.class 796B
CustomerLogOnFrm$1.class 793B
CustomerLogOnFrm$2.class 793B
ManagerLogOnFrm$3.class 786B
ManagerLogOnFrm$1.class 786B
ManagerLogOnFrm$2.class 786B
FuntionMainFrm$1.class 779B
FuntionMainFrm$2.class 779B
FuntionMainFrm$3.class 779B
ProductBuyInterFrm$3.class 775B
ProductBuyInterFrm$5.class 775B
ViewMainFrm$3.class 758B
ViewMainFrm$1.class 758B
ViewMainFrm$2.class 758B
MainFrm$3.class 730B
MainFrm$1.class 730B
MainFrm$4.class 730B
MainFrm$2.class 730B
MainFrm$5.class 730B
StringUtil.class 616B
CustomerLogOnFrm$3.class 565B
ManagerLogOnFrm$4.class 561B
FuntionMainFrm$4.class 557B
ViewMainFrm$4.class 545B
MainFrm$6.class 529B
.classpath 427B
test.clw 3KB
test.cpp 2KB
java Swing mysql实现简单的购物系统项目源码.doc 366KB
提高自己的编程技巧.doc 31KB
各种编程语言的区别与联系.doc 25KB
test.dsp 4KB
test.dsw 533B
ProductBuyInterFrm.form 22KB
ProductBuyInterFrm.form 22KB
ProductManageInterFrm.form 20KB
ProductManageInterFrm.form 20KB
ProductTypeManageInterFrm.form 12KB
ProductTypeManageInterFrm.form 12KB
ProductAddInterFrm.form 10KB
ProductAddInterFrm.form 10KB
MainFrm.form 9KB
MainFrm.form 9KB
ManagerLogOnFrm.form 8KB
ManagerLogOnFrm.form 8KB
CustomerLogOnFrm.form 7KB
CustomerLogOnFrm.form 7KB
ProductTypeInterFrm.form 7KB
ProductTypeInterFrm.form 7KB
CustomerAddInterFrm.form 6KB
CustomerAddInterFrm.form 6KB
共 168 条
- 1
- 2
资源评论
- qq_543911262022-07-11资源内容详实,描述详尽,解决了我的问题,受益匪浅,学到了。
毕业设计方案专家
- 粉丝: 3422
- 资源: 1903
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于STM32F103C8T6单片机蓄电池在线监测系统主板硬件(原理图+PCB)工程文件.zip
- mysql大纲资料.txt
- c++大纲资料.txt
- 效率工具bat脚本实现日志提取
- MyBatis 中动态 SQL 的示例
- STM8L101F3P6单片机+CC1100模块433M遥控器设计硬件(原理图+PCB)工程文件.zip
- 上传下载铁人下载系统 Liuxing 1.0-liuxing1.0.rar
- 南京邮电大学数学实验实力雄厚,凭借其优秀的师资力量、丰富的实践教学资源和卓越的科研成果,成为国内一流的数学实验教学和科研基地
- 【火爆朋友圈的今天吃什么源码 v1.0】随机的为用户带来每一天的用餐选择和推荐.rar
- MPU6050中文版数据手册
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功