资源简介
该系统基于mysql+eclipse+jdk1.6(内部有注释,系统完整)
实现3张表的增删查改操作
简单GUI操作界面
适合课程设计

代码片段和文件信息
package com.system.main;
import java.awt.Container;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.Jframe;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPasswordField;
import javax.swing.JTextField;
import com.system.main.Login.ButtonListener;
import com.system.sql.Product;
import com.system.sql.User;
public class AddPro extends Jframe{
private JButton addbtn;
private JButton changebtn;
//用户与密码标签
private JLabel lab1lab2lab3lab4;
//4个输入框
JTextField pname;
JTextField pnum;
JTextField pprice;
JTextField pclass;
public AddPro(){
this.init();
}
public void init() {
Container con=super.getContentPane();//顶级容器
con.setLayout(null);
lab1=new JLabel(“商品名:“);
lab1.setBounds(5510060);
pname=new JTextField(20);
pname.setBounds(502020030);
lab2=new JLabel(“数 量:“);
lab2.setBounds(53510060);
pnum=new JTextField(20);
pnum.setBounds(505020030);
lab3=new JLabel(“价 格:“);
lab3.setBounds(56510060);
pprice=new JTextField(20);
pprice.setBounds(508020030);
lab4=new JLabel(“种 类:“);
lab4.setBounds(59510060);
pclass=new JTextField(20);
pclass.setBounds(5011020030);
addbtn=new JButton(“添加“);
addbtn.setBounds(301607030);
changebtn=new JButton(“更改“);
changebtn.setBounds(1301607030);
//依次添加组件
con.add(lab1);
con.add(lab2);
con.add(lab3);
con.add(lab4);
con.add(pname);
con.add(pnum);
con.add(pprice);
con.add(pclass);
con.add(addbtn);
con.add(changebtn);
//设置属性
super.settitle(“添加商品“);
super.setSize(350 272);
super.setResizable(false);
super.setDefaultCloseOperation(super.DISPOSE_ON_CLOSE);
super.setVisible(true);
//给2个按钮添加监听
ButtonListener listener1 = new ButtonListener();
addbtn.addActionListener(listener1);
changebtn.addActionListener(listener1);
}
//事件监听器接口
class ButtonListener implements ActionListener{
public void actionPerformed(ActionEvent e){
object source=e.getSource();
Product product = new Product();
if(source instanceof JButton ){
JButton jb=(JButton)source;//按钮
String txt=jb.getText();
String name = pname.getText();
int num = Integer.parseInt(pnum.getText());
int price = Integer.parseInt(pprice.getText());
String pclazz = pclass.getText();
if(txt.equals(“添加“)){
if(!(name.equals(““)&&pnum.getText().equals(““)&&pprice.getText().equals(““)&&
pclazz.equals(““))) {
if(product.addPro(namenumpricepclazz)) {
JOptionPane.showMessageDialog(null “添加成功!“);
}
}else {
JOptionPane.showMessageDialog(null “添加失败!“);
}
}else if(txt.equals(“更改“)){
if(!(name.equals(““)&&pnum.getText().equals(““)&&pprice.getText().equ
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-07-19 17:01 GUI的超市管理系统(mysql+java)\
文件 1844 2018-07-19 16:53 GUI的超市管理系统(mysql+java)\market.sql
目录 0 2018-07-19 16:54 GUI的超市管理系统(mysql+java)\product_system\
文件 384 2018-07-01 15:10 GUI的超市管理系统(mysql+java)\product_system\.classpath
文件 390 2018-07-01 01:46 GUI的超市管理系统(mysql+java)\product_system\.project
目录 0 2018-07-19 16:54 GUI的超市管理系统(mysql+java)\product_system\.settings\
文件 718 2018-07-19 16:41 GUI的超市管理系统(mysql+java)\product_system\.settings\org.eclipse.jdt.core.prefs
目录 0 2018-07-19 16:56 GUI的超市管理系统(mysql+java)\product_system\bin\
目录 0 2018-07-19 16:56 GUI的超市管理系统(mysql+java)\product_system\bin\com\
目录 0 2018-07-19 16:56 GUI的超市管理系统(mysql+java)\product_system\bin\com\system\
目录 0 2018-07-19 16:56 GUI的超市管理系统(mysql+java)\product_system\bin\com\system\main\
文件 2136 2018-07-19 16:56 GUI的超市管理系统(mysql+java)\product_system\bin\com\system\main\AddPro$ButtonListener.class
文件 2220 2018-07-19 16:56 GUI的超市管理系统(mysql+java)\product_system\bin\com\system\main\AddPro.class
文件 2246 2018-07-19 16:59 GUI的超市管理系统(mysql+java)\product_system\bin\com\system\main\Login$ButtonListener.class
文件 2352 2018-07-19 16:59 GUI的超市管理系统(mysql+java)\product_system\bin\com\system\main\Login.class
文件 826 2018-07-19 16:56 GUI的超市管理系统(mysql+java)\product_system\bin\com\system\main\Product_Management$1.class
文件 1481 2018-07-19 16:56 GUI的超市管理系统(mysql+java)\product_system\bin\com\system\main\Product_Management$2.class
文件 1924 2018-07-19 16:56 GUI的超市管理系统(mysql+java)\product_system\bin\com\system\main\Product_Management$3.class
文件 1208 2018-07-19 16:56 GUI的超市管理系统(mysql+java)\product_system\bin\com\system\main\Product_Management$4.class
文件 1214 2018-07-19 16:56 GUI的超市管理系统(mysql+java)\product_system\bin\com\system\main\Product_Management$5.class
文件 826 2018-07-19 16:56 GUI的超市管理系统(mysql+java)\product_system\bin\com\system\main\Product_Management$6.class
文件 1298 2018-07-19 16:56 GUI的超市管理系统(mysql+java)\product_system\bin\com\system\main\Product_Management$7.class
文件 1802 2018-07-19 16:56 GUI的超市管理系统(mysql+java)\product_system\bin\com\system\main\Product_Management$8.class
文件 3956 2018-07-19 16:56 GUI的超市管理系统(mysql+java)\product_system\bin\com\system\main\Product_Management.class
文件 2222 2018-07-19 16:56 GUI的超市管理系统(mysql+java)\product_system\bin\com\system\main\Regist$ButtonListener.class
文件 2390 2018-07-19 16:56 GUI的超市管理系统(mysql+java)\product_system\bin\com\system\main\Regist.class
目录 0 2018-07-19 16:56 GUI的超市管理系统(mysql+java)\product_system\bin\com\system\sql\
文件 2287 2018-07-19 16:56 GUI的超市管理系统(mysql+java)\product_system\bin\com\system\sql\Loj.class
文件 4297 2018-07-19 16:56 GUI的超市管理系统(mysql+java)\product_system\bin\com\system\sql\Product.class
文件 1675 2018-07-19 16:56 GUI的超市管理系统(mysql+java)\product_system\bin\com\system\sql\User.class
目录 0 2018-07-19 16:56 GUI的超市管理系统(mysql+java)\product_system\bin\com\system\sqlserverConn\
............此处省略16个文件信息
相关资源
- java串口通信全套完整代码-导入eclip
- jsonarray所必需的6个jar包.rar
- 三角网构TIN生成算法,Java语言实现
- java代码编写将excel数据导入到mysql数据
- Java写的cmm词法分析器源代码及javacc学
- JAVA JSP公司财务管理系统 源代码 论文
- JSP+MYSQL旅行社管理信息系统
- 推荐算法的JAVA实现
- 基于Java的酒店管理系统源码(毕业设
- java-图片识别 图片比较
- android毕业设计
- java23种设计模式+23个实例demo
- java Socket发送/接受报文
- JAVA828436
- java界面美化 提供多套皮肤直接使用
- 在线聊天系统(java代码)
- 基于Java的图书管理系统807185
- java中实现将页面数据导入Excel中
- java 企业销售管理系统
- java做的聊天系统(包括正规课程设计
- Java编写的qq聊天室
- 商店商品管理系统 JAVA写的 有界面
- JAVA开发聊天室程序
- 在linux系统下用java执行系统命令实例
- java期末考试试题两套(答案) 选择(
- JAVA3D编程示例(建模、交互)
- Java 文件加密传输
- java做的房产管理系统
- 基于jsp的bbs论坛 非常详细
- [免费]java实现有障碍物的贪吃蛇游戏
评论
共有 条评论