数据库课程设计商品销售管理系统

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

数据库课程设计商品销售管理系统

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);

s etBak();

JPanel panel = new JPanel();

p anel.setOpaque(false);

c t.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_V ALUE));

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(String[]args){

LoginBackPanel lgp=new LoginBackPanel("管理系统登录");

lgp.setDefaultCloseOperation(JFrame.EXIT_O N_CLOSE);

lgp.setSize(300,200);

lgp.setLocation(550,250);

lgp.setVisible(true);

}

}

class BS extends JFrame implements ActionListener{

JButton B1,B2,B3,B4,B5,B6,B7;

Container ct = getContentPane();

public BS(String str){

super(str);

s etBak();

JPanel JP = new JPanel();

J P.setOpaque(false);

c t.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);

相关文档
最新文档