已阅读5页,还剩45页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
import java.awt.event.*;import java.awt.*;import javax.swing.*;import java.sql.*;import javax.swing.table.AbstractTableModel;public class LoginBackPanel extends JFrame implements ActionListener private static final long serialVersionUID = 1L; JButton button1,button2; JTextField F1; Choice c; Container ct = getContentPane(); public LoginBackPanel(String str) super(str); setBak(); JPanel panel = new JPanel(); panel.setOpaque(false); ct.add(panel); panel.setLayout(new FlowLayout(FlowLayout.CENTER,60,20); c = new Choice(); c.add( Boss ); c.add( Salesman ); JLabel J1 = new JLabel(验证身份:); JLabel J2 = new JLabel(登录密码:); F1 = new JTextField(9); button1 = new JButton(登录); button2 = new JButton(退出); button1.addActionListener(this); button2.addActionListener(this);panel.add(J1); panel.add(c); panel.add(J2); panel.add(F1); panel.add(button1);panel.add(button2);add(panel); public void setBak() /设置背景方法 (JPanel)this.getContentPane().setOpaque(false); ImageIcon img = new ImageIcon(e:/数据库课程设计/六月物语.jpg); JLabel background = new JLabel(img); this.getLayeredPane().add(background, new Integer(Integer.MIN_VALUE); background.setBounds(0, 0, img.getIconWidth(), img.getIconHeight(); public void actionPerformed(ActionEvent e) if(e.getSource()=button1) if(c.getSelectedItem().equals( Boss )&F1.getText().equals(boss) this.dispose(); BS bs=new BS(管理员界面); bs.setSize(500,250); bs.setLocation(450,250); bs.setVisible(true); if(c.getSelectedItem().equals( Salesman )&F1.getText().equals(salesman) this.dispose(); SL sl=new SL(销售员界面); sl.setSize(500,250); sl.setLocation(450,250); sl.setVisible(true); if(e.getSource()=button2) System.exit(0); public static void main(Stringargs)LoginBackPanel lgp=new LoginBackPanel(管理系统登录); lgp.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); lgp.setSize(300,200); lgp.setLocation(550,250); lgp.setVisible(true); class BS extends JFrame implements ActionListenerJButton B1,B2,B3,B4,B5,B6,B7;Container ct = getContentPane(); public BS(String str)super(str); setBak(); JPanel JP = new JPanel(); JP.setOpaque(false); ct.add(JP);JP.setLayout(new FlowLayout(FlowLayout.CENTER,30,50);B1 = new JButton(销售情况);B2 = new JButton(客户退货);B3 = new JButton(销售收款);B4 = new JButton(客户信息);B5 = new JButton(员工管理);B6 = new JButton(进货信息);B7 = new JButton(更换角色);B1.addActionListener(this);B2.addActionListener(this);B3.addActionListener(this);B4.addActionListener(this);B5.addActionListener(this);B6.addActionListener(this);B7.addActionListener(this);JP.add(B1);JP.add(B2);JP.add(B3);JP.add(B4);JP.add(B5);JP.add(B6);JP.add(B7);add(JP); public void setBak() (JPanel)this.getContentPane().setOpaque(false);ImageIcon img = new ImageIcon(e:/数据库课程设计/六月物语1.jpg); JLabel background = new JLabel(img); this.getLayeredPane().add(background, new Integer(Integer.MIN_VALUE); background.setBounds(0, 0, img.getIconWidth(), img.getIconHeight(); public void actionPerformed(ActionEvent e)if(e.getSource()=B1) this.dispose(); CXFPXX cxfpxx = new CXFPXX(日常销售【发票情况】); cxfpxx.setSize(700,300); cxfpxx.setLocation(350,250); cxfpxx.setVisible(true); if(e.getSource()=B2) this.dispose(); XSTHXX xsthxx = new XSTHXX(日常销售【销售退货】); xsthxx.setSize(700,300); xsthxx.setLocation(350,250); xsthxx.setVisible(true); if(e.getSource()=B3) this.dispose(); XSXXCX xsxxcx = new XSXXCX(日常销售【销售收款】); xsxxcx.setSize(700,300); xsxxcx.setLocation(350,250); xsxxcx.setVisible(true);if(e.getSource()=B4) this.dispose(); HYXXCX hyxxcx = new HYXXCX(基本信息管理【会员信息】); hyxxcx.setSize(700,300); hyxxcx.setLocation(350,250); hyxxcx.setVisible(true);if(e.getSource()=B5) this.dispose(); YGGL yggl = new YGGL(员工管理【员工信息】); yggl.setSize(500,200); yggl.setLocation(450,250); yggl.setVisible(true);if(e.getSource()=B6) this.dispose(); JHXX jhxx = new JHXX(商品更新【进货信息】); jhxx.setSize(300,150); jhxx.setLocation(500,250); jhxx.setVisible(true);if(e.getSource()=B7) this.dispose(); LoginBackPanel xt = new LoginBackPanel(管理系统登录); xt.setSize(300,200); xt.setLocation(550,250); xt.setVisible(true);class BG2 extends AbstractTableModelString rq,ph,mc,bh,dj,sl,je;final String columnNames=开票日期,销售票号,商品名称,商品编号,商品单价/元,销售数量/个,销售金额/元;Objectdata=new Object1007;public BG2()int m=0; String url=jdbc:microsoft:sqlserver:/localhost:1433;DatabaseName=课程设计; Connection con; String sql; Statement stmt; try Class.forName(com.microsoft.jdbc.sqlserver.SQLServerDriver); catch(java.lang.ClassNotFoundException e) try con=DriverManager.getConnection(url,sa,123456); stmt=con.createStatement(); sql=SELECT * FROM 销售发票 ; ResultSet rs=stmt.executeQuery(sql); while(rs.next()rq=rs.getString(1);ph=rs.getString(2);mc=rs.getString(3);bh=rs.getString(4);dj=rs.getString(5);sl=rs.getString(6);je=rs.getString(7);datam0=rq;datam1=ph;datam2=mc;datam3=bh;datam4=dj;datam5=sl;datam+6=je; stmt.close(); con.close();catch(SQLException e)System.out.println(0); public int getColumnCount()return columnNames.length;public int getRowCount()return data.length;public String getColumnName(int col)return columnNamescol;public Object getValueAt(int row,int col)return datarowcol;public void setValueAt(Object value,int row,int col) int numRows=getRowCount();int numCols=getColumnCount();for(int i=0;inumRows;i+)for(int j=0;jnumCols;j+)System.out.print( +dataij);class CXFPXX extends JFrame implements ActionListener BG2 bg2; JTable t; JButton b; JPanel p; JScrollPane s;public CXFPXX(String str)super(str);setLayout(new BorderLayout();b = new JButton(确定);b.addActionListener(this);p = new JPanel();p.add(b);bg2 = new BG2();t = new JTable(bg2);s = new JScrollPane(t);add(s,Center);add(p,South);public void actionPerformed(ActionEvent e)if(e.getSource()=b) this.dispose(); BS cxfpxx = new BS(管理员界面); cxfpxx.setSize(500,250); cxfpxx.setLocation(450,250); cxfpxx.setVisible(true); class BG3 extends AbstractTableModelString rq,mc,yy,sl,je;final String columnNames=退货日期,商品名称,退货原因,退货数量/件,退货金额/元;Objectdata=new Object1005;public BG3()int m=0; String url=jdbc:microsoft:sqlserver:/localhost:1433;DatabaseName=课程设计; Connection con; String sql; Statement stmt; try Class.forName(com.microsoft.jdbc.sqlserver.SQLServerDriver); catch(java.lang.ClassNotFoundException e) try con=DriverManager.getConnection(url,sa,123456); stmt=con.createStatement(); sql=SELECT * FROM 退货记录 ; ResultSet rs=stmt.executeQuery(sql); while(rs.next() rq=rs.getString(1); mc=rs.getString(2); yy=rs.getString(3); sl=rs.getString(4); je=rs.getString(5); datam0=rq;datam1=mc;datam2=yy;datam3=sl;datam+4=je; stmt.close(); con.close();catch(SQLException e)System.out.println(0); public int getColumnCount()return columnNames.length;public int getRowCount()return data.length;public String getColumnName(int col)return columnNamescol;public Object getValueAt(int row,int col)return datarowcol;public void setValueAt(Object value,int row,int col) int numRows=getRowCount();int numCols=getColumnCount();for(int i=0;inumRows;i+)for(int j=0;jnumCols;j+)System.out.print( +dataij);class XSTHXX extends JFrame implements ActionListener BG3 bg3; JTable t; JButton b; JPanel p; JScrollPane s;public XSTHXX(String str)super(str);setLayout(new BorderLayout();b = new JButton(确定);b.addActionListener(this);p = new JPanel();p.add(b);bg3 = new BG3();t = new JTable(bg3);s = new JScrollPane(t);add(s,Center);add(p,South);public void actionPerformed(ActionEvent e)if(e.getSource()=b) this.dispose(); BS cxfpxx = new BS(管理员界面); cxfpxx.setSize(500,250); cxfpxx.setLocation(450,250); cxfpxx.setVisible(true); class BG4 extends AbstractTableModelString rq,mc,dj,sl,je;final String columnNames=开票日期,商品名称,商品单价/元,销售数量/个,销售金额/元;Objectdata=new Object1005;public BG4()int m=0; String url=jdbc:microsoft:sqlserver:/localhost:1433;DatabaseName=课程设计; Connection con; String sql; Statement stmt; try Class.forName(com.microsoft.jdbc.sqlserver.SQLServerDriver); catch(java.lang.ClassNotFoundException e) try con=DriverManager.getConnection(url,sa,123456); stmt=con.createStatement(); sql=SELECT 开票日期,商品名称,商品单价/元,销售数量/个,销售金额/元 FROM 销售发票 ; ResultSet rs=stmt.executeQuery(sql); while(rs.next() rq=rs.getString(1);mc=rs.getString(2);dj=rs.getString(3);sl=rs.getString(4);je=rs.getString(5);datam0=rq;datam1=mc;datam2=dj;datam3=sl;datam+4=je; stmt.close(); con.close();catch(SQLException e)System.out.println(0); public int getColumnCount()return columnNames.length;public int getRowCount()return data.length;public String getColumnName(int col)return columnNamescol;public Object getValueAt(int row,int col)return datarowcol;public void setValueAt(Object value,int row,int col) int numRows=getRowCount();int numCols=getColumnCount();for(int i=0;inumRows;i+)for(int j=0;jnumCols;j+)System.out.print( +dataij);class XSXXCX extends JFrame implements ActionListener BG4 bg4; JTable t; JButton b; JPanel p; JScrollPane s;public XSXXCX(String str)super(str);setLayout(new BorderLayout();b = new JButton(确定);b.addActionListener(this);p = new JPanel();p.add(b);bg4 = new BG4();t = new JTable(bg4);s = new JScrollPane(t);add(s,Center);add(p,South);public void actionPerformed(ActionEvent e)if(e.getSource()=b) this.dispose(); BS cxfpxx = new BS(管理员界面); cxfpxx.setSize(500,250); cxfpxx.setLocation(450,250); cxfpxx.setVisible(true); class BG5 extends AbstractTableModelString ch,lx,dz,rq;final String columnNames=客户称呼,联系方式,客户地址,入会日期;Objectdata=new Object1004;public BG5()int m=0; String url=jdbc:microsoft:sqlserver:/localhost:1433;DatabaseName=课程设计; Connection con; String sql; Statement stmt; try Class.forName(com.microsoft.jdbc.sqlserver.SQLServerDriver); catch(java.lang.ClassNotFoundException e) try con=DriverManager.getConnection(url,sa,123456); stmt=con.createStatement(); sql=SELECT * FROM 客户信息 ; ResultSet rs=stmt.executeQuery(sql); while(rs.next() ch=rs.getString(1);lx=rs.getString(2);dz=rs.getString(3);rq=rs.getString(4);datam0=ch;datam1=lx;datam2=dz;datam+3=rq; stmt.close(); con.close();catch(SQLException e)System.out.println(0); public int getColumnCount()return columnNames.length;public int getRowCount()return data.length;public String getColumnName(int col)return columnNamescol;public Object getValueAt(int row,int col)return datarowcol;public void setValueAt(Object value,int row,int col) int numRows=getRowCount();int numCols=getColumnCount();for(int i=0;inumRows;i+)for(int j=0;jnumCols;j+)System.out.print( +dataij);class HYXXCX extends JFrame implements ActionListener BG5 bg5; JTable t; JButton b; JPanel p; JScrollPane s;public HYXXCX(String str)super(str);setLayout(new BorderLayout();b = new JButton(确定);b.addActionListener(this);p = new JPanel();p.add(b);bg5 = new BG5();t = new JTable(bg5);s = new JScrollPane(t);add(s,Center);add(p,South);public void actionPerformed(ActionEvent e)if(e.getSource()=b) this.dispose(); BS cxfpxx = new BS(管理员界面); cxfpxx.setSize(500,250); cxfpxx.setLocation(450,250); cxfpxx.setVisible(true); class YGGL extends JFrame implements ActionListenerJButton B1,B2,B3,B4,B5;Container ct = getContentPane();public YGGL(String str)super(str); setBak(); JPanel panel = new JPanel(); panel.setOpaque(false);panel.setLayout(new FlowLayout(FlowLayout.CENTER,60,40);B1 = new JButton(添加员工);B2 = new JButton(删除员工);B3 = new JButton(员工名单);B4 = new JButton(更新信息);B5 = new JButton(返回);B1.addActionListener(this);B2.addActionListener(this);B3.addActionListener(this);B4.addActionListener(this);B5.addActionListener(this);panel.add(B1);panel.add(B2);panel.add(B3);panel.add(B4);panel.add(B5);add(panel); public void setBak() (JPanel)this.getContentPane().setOpaque(false); ImageIcon img = new ImageIcon(e:/数据库课程设计/六月物语1.jpg); JLabel background = new JLabel(img); this.getLayeredPane().add(background, new Integer(Integer.MIN_VALUE); background.setBounds(0, 0, img.getIconWidth(), img.getIconHeight(); public void actionPerformed(ActionEvent e)if(e.getSource()=B1) this.dispose(); TJYG tjyg = new TJYG(员工管理【添加员工】); tjyg.setSize(400,350); tjyg.setLocation(450,200); tjyg.setVisible(true); if(e.getSource()=B2) this.dispose(); SCYG scyg = new SCYG(员工管理【删除员工】); scyg.setSize(300,150); scyg.setLocation(550,300); scyg.setVisible(true); if(e.getSource()=B3) this.dispose(); YGMDXX ygmdxx = new YGMDXX(员工管理【员工名单】); ygmdxx.setSize(700,300); ygmdxx.setLocation(350,250); ygmdxx.setVisible(true); if(e.getSource()=B4) this.dispose(); GXXX gxxx = new GXXX(员工管理【更新信息】); gxxx.setSize(300,200); gxxx.setLocation(500,250); gxxx.setVisible(true); if(e.getSource()=B5) this.dispose(); BS bs = new BS(管理员界面); bs.setSize(500,250); bs.setLocation(450,250); bs.setVisible(true); class TJYG extends JFrame implements ActionListenerJLabel L1,L2,L3,L4,L5;JTextField T1,T2,T3,T4,T5;JButton B1,B2;Container ct = getContentPane();public TJYG(String str)super(str); setBak(); JPanel panel = new JPanel(); panel.setOpaque(false);panel.setLayout(new FlowLayout(FlowLayout.CENTER,60,25);L1 = new JLabel(员工名称:);L2 = new JLabel(员工编号:);L3 = new JLabel(员工职位:);L4 = new JLabel(聘请日期:);L5 = new JLabel(联系方式:);T1=new JTextField(10);T2=new JTextField(10);T3=new JTextField(10);T4=new JTextField(10);T5=new JTextField(10);B1 = new JButton(确定);B2 = new JButton(返回);B1.addActionListener(this);B2.addActionListener(this);panel.add(L1);panel.add(T1);panel.add(L2);panel.add(T2);panel.add(L3);panel.add(T3);panel.add(L4);panel.add(T4);panel.add(L5);panel.add(T5);panel.add(B1);panel.add(B2);add(panel); public void setBak() (JPanel)this.getContentPane().setOpaque(false); ImageIcon img = new ImageIcon(e:/数据库课程设计/六月物语2.jpg); JLabel background = new JLabel(img); this.getLayeredPane().add(background, new Integer(Integer.MIN_VALUE); background.setBounds(0, 0, img.getIconWidth(), img.getIconHeight(); public void actionPerformed(ActionEvent e) if(e.getSource()=B1) String url=jdbc:microsoft:sqlserver:/l
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 毕业论文提纲参考模板样式
- 基于供应链管理的施工企业物资采购管理优化
- 本科毕业论文格式要求及模板
- 浅谈治风与治血的关系-杨玲
- 论文开题报告技术路线图怎么画
- 大学毕业论文评语写
- 汉语言文学专业毕业论文选题范围
- 四川达州中考语文试题及答
- 幼儿园奖状内容怎么写范文五
- 理论研究和经验研究在社会科学研究中的应用与比较
- 2025年江西省直遴选面试真题附带题目详解及答案
- 2024年六西格玛黑带认证高级考试真题(含答案解析)
- 乐山大佛课件
- 2025年物业管理行业职业技能竞赛物业管理员考试试题真题及答案
- 《2025年下半年事业单位考试职业能力倾向测验真题及解析》
- 义务教育优-质均衡发展创建省级督导评估迎检方案
- 石家庄写字楼市场调研报告
- 仓库货物盘点流程与货物分类标准化操作指南
- 【初中政治】敬畏生命课件-2025-2026学年统编版道德与法治七年级上册
- GB 5725-2025坠落防护安全网
- (正式版)DB61∕T 1922-2024 《城镇燃气管道安全隐患分级及处置规范》
评论
0/150
提交评论