package zuoye;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.sql.SQLException;
public class OperationGUI extends JFrame implements MouseListener, ItemListener {
private JTabbedPane jtabbedpane;
private JPanel jpanel1,jpanel2,jPanel3,jPanel4,jpanel5;
private JButton Insertinformation,DeleteProduct,UpdateProduct,QueryOrder,QueryOrder2;//Query;
private JLabel InsertPname2, InsertPlace2, InsertRemaing_number2, InsertType2, InsertUnit_price2, Insertvarieties2,//插入农产品基本信息
DeleteVari2, //删除的品种
UpdateNumber2, UpdatePrice2, UpdateName2, //更新剩余的数量
Picturelabel1,Picturelabel2,Picturelabel3,Picturelabel4,Picturelabel5; //插入的图片
private JTextField InsertPname1, InsertPlace1, InsertRemaing_number1, InsertType1, InsertUnit_price1, Insertvarieties1, //要插入的农产品信息表
DeleteVari1, // 删除农产品
UpdateNumber1, UpdatePrice1, UpdateName1, //更新的农产品数量和单价
OrderCondition, CustomCondition, ProductConditon,
PlaceCondition,TypeCondition;
private JTextArea QueryResult,QueryRusltProduct; //查询结果的输出表
private JRadioButton order,CustomNumber, Productname,//按照农产品 按照订单号查询,按照顾客编号查询
Place,Type;
private JScrollPane scroll,Productscorll = null;
private Opengauss db = null;
private ImageIcon picture;
OperationGUI(){
setPicture();
// 设置各按钮信息
setButton();
// 设置各标签信息
setLabel();
// 设置各文本框信息
setTextField();
// 设置各面板信息
setPanel();
// 设置布局信息
setLayout();
// 设置选项卡信息
setBase();
// 设置主窗口信息
setThis();
// 连接数据库信息
//Connect();
db = new Opengauss();
}
private void setPicture(){
picture = new ImageIcon("G:\\magic1\\4.png");
picture.setImage(picture.getImage().getScaledInstance(280,250,100));
Picturelabel1 = new JLabel();
Picturelabel1.setIcon(picture);
Picturelabel2 = new JLabel();
Picturelabel2.setIcon(picture);
Picturelabel3 = new JLabel();
Picturelabel3.setIcon(picture);
Picturelabel4 = new JLabel();
Picturelabel4.setIcon(picture);
Picturelabel5 = new JLabel();
Picturelabel5.setIcon(picture);
}
private void setButton(){
//插入农产品信息的按钮
Insertinformation = new JButton("添加");
Insertinformation.setFont(new Font("宋体",1,20));
Insertinformation.setBounds(150,400,100,45);
Insertinformation.setMargin(new Insets(0,0,0,0));
//删除农产品信息的按钮
DeleteProduct = new JButton("删除");
DeleteProduct.setFont(new Font("宋体", 1, 20));
DeleteProduct.setBounds(150, 350, 100, 45);
DeleteProduct.setMargin(new Insets(0, 0, 0, 0));
//更新农产品单价和数量的按钮
UpdateProduct = new JButton("更新");
UpdateProduct.setFont(new Font("宋体", 1, 20));
UpdateProduct.setBounds(250, 400, 100, 45);
//查询订单信息
order = new JRadioButton("订单");
order.setFont(new Font("宋体", 1, 15));
order.setMargin(new Insets(0, 0, 0, 0));
order.setBounds(30, 300, 55, 20);
CustomNumber = new JRadioButton("顾客");
CustomNumber.setFont(new Font("宋体", 1, 15));
CustomNumber.setMargin(new Insets(0, 0, 0, 0));
CustomNumber.setBounds(30, 330, 55, 20);
QueryOrder = new JButton("查询");
QueryOrder.setFont(new Font("宋体", 1, 20));
QueryOrder.setMargin(new Insets(0, 0, 0, 0));
QueryOrder.setBounds(250, 400, 100, 45);
Place = new JRadioButton("产地");
Place.setFont(new Font("宋体", 1, 15));
Place.setMargin(new Insets(0, 0, 0, 0));
Place.setBounds(30, 300, 55, 20);
Type = new JRadioButton("类型");
Type.setFont(new Font("宋体", 1, 15));
Type.setMargin(new Insets(0, 0, 0, 0));
Type.setBounds(30, 330, 55, 20);
QueryOrder2 = new JButton("查询");
QueryOrder2.setFont(new Font("宋体", 1, 20));
QueryOrder2.setMargin(new Insets(0, 0, 0, 0));
QueryOrder2.setBounds(250, 400, 100, 45);
//初始化
initial();
}
private void setLabel(){
//插入农产品信息的标签——第一个标签页
InsertPname2 = new JLabel("农产品:");
InsertPname2.setFont(new Font("宋体",1,22));
InsertPname2.setBackground(Color.GREEN);
InsertPname2.setBounds(100, 30, 120, 50);
InsertPlace2 = new JLabel("产地:");
InsertPlace2.setFont(new Font("宋体", 1, 22));
InsertPlace2.setBackground(Color.GREEN);
InsertPlace2.setBounds(100, 80, 120, 50);
Insertvarieties2 = new JLabel("品种:");
Insertvarieties2.setFont(new Font("宋体", 1, 22));
Insertvarieties2.setBackground(Color.GREEN);
Insertvarieties2.setBounds(100, 130, 120, 50);
InsertRemaing_number2 = new JLabel("剩余数量:");
InsertRemaing_number2.setFont(new Font("宋体", 1, 22));
InsertRemaing_number2.setBackground(Color.GREEN);
InsertRemaing_number2.setBounds(100, 180, 120, 50);
InsertUnit_price2 = new JLabel("单价:");
InsertUnit_price2.setFont(new Font("宋体", 1, 22));
InsertUnit_price2.setBackground(Color.GREEN);
InsertUnit_price2.setBounds(100, 230, 120, 50);
InsertType2 = new JLabel("种类:");
InsertType2.setFont(new Font("宋体", 1, 22));
InsertType2.setBackground(Color.GREEN);
InsertType2.setBounds(100,280 , 120, 50);
Picturelabel2.setBounds(400,200,280,250);
//要删除的农产品品种
DeleteVari2 = new JLabel("品种:");
DeleteVari2.setBounds(100,100,100,50);
DeleteVari2.setFont(new Font("宋体",1,22));
Picturelabel1.setBounds(400,200,280,250);
//要更新的农产品库存和价格
UpdateName2 = new JLabel("品种:");
UpdateName2.setFont(new Font("宋体", 1, 22));
UpdateName2.setBounds(100, 30, 120, 50);
UpdateNumber2 = new JLabel("余量:");
UpdateNumber2.setFont(new Font("宋体", 1, 22));
UpdateNumber2.setBounds(100, 100, 120, 50);
UpdatePrice2 = new JLabel("单价:");
UpdatePrice2.setFont(new Font("宋体", 1, 22));
UpdatePrice2.setBounds(100, 170, 120, 50);
Picturelabel3.setBounds(400,200,280,250);
Picturelabel4.setBounds(400,200,280,250);
Picturelabel5.setBounds(400,200,280,250);
}
private void setTextField(){
//第一个页面
InsertPname1 = new JTextField();
InsertPname1.setFont(new Font("宋体", 1, 23));
InsertPname1.setBounds(210, 30, 200, 35);
InsertPlace1 = new JTextField();
InsertPlace1.setFont(new Font("宋体", 1, 23));
InsertPlace1.setBounds(210, 80, 200, 35);
Insertvarieties1 = new JTextField();
Insertvarieties1.setFont(new Font("宋体", 1, 23));
Insertvarieties1.setBounds(210, 130, 200, 35);
InsertRemaing_number1 = new JTextField();
InsertRemaing_number1.setFont(new Font("宋体", 1, 23));
InsertRemaing_number1.setBounds(210, 180, 200, 35);
InsertUnit_price1= new JTextField();
InsertUnit_price1.setFont(new Font("宋体", 1, 23));
InsertUnit_price1.setBounds(210, 230,
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
农产品信息管理系统.zip (6个子文件)
database-main
CustomGUI.java 8KB
test.java 159B
Opengauss.java 9KB
OperationGUI.java 21KB
PostGUI.java 5KB
Login.java 3KB
共 6 条
- 1
资源评论
博士僧小星
- 粉丝: 1884
- 资源: 5877
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功