数据库设计商品销售管理
系统
import java.awt.event.*;
import java.awt.*;
import javax.swing.*;
import java.sql. *;
import javax.swing.tab le.AbstractT ableMod el;
public class LoginBackPanel extends JFrame implements ActionListener{ private static final long serialVersionUID = 1L;
JButton button1,button2;
JTextField F1;
Choice c;
Container ct = getContentPan e();
public LoginBackPanel(String str){
super(str);
setBak();
JPanel panel = new JPanel();
panel.setOpaque(false);
ct.add(panel);
p anel.setLayout(n ew 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());
}。