1.技术介绍
java+swing+mysql
2.主要功能说明:
登录
1)管理员
员工信息管理(新增、修改、删除、查询)
顾客信息管理(新增、修改、删除、查询)
2)收银员
分为会员收银和非会员收银
添加商品、查询商品、删除商品、对商品进行结算、清空
3)商品管理员
查询所有商品、更新库存信息、新增商品、删除商品
3.核心代码实现:
public class Test {
public static void main(String[] args) {
Login login = new Login();
login.setVisible(true);
}
}
public class Login extends JFrame {
private JPanel contentPane;
private JTextField userName;
private JTextField pwd;
private int roleId = 0;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
Login frame = new Login();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the frame.
*/
public Login() {
this.setTitle("超市管理系统");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(400, 200, 450, 300);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
JLabel lblNewLabel = new JLabel("用户名:");
lblNewLabel.setBounds(82, 52, 54, 15);
contentPane.add(lblNewLabel);
userName = new JTextField();
userName.setBounds(186, 49, 141, 21);
contentPane.add(userName);
userName.setColumns(10);
JLabel label = new JLabel