You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Hotel_service_system/ServiceTablemodel.java

73 lines
2.4 KiB

package com.lsy.ui;
import com.lsy.dao.AccountDaolsy;
import com.lsy.dao.impl.AccountDaoImplsy;
import com.lsy.model.Accountlsy;
import javax.swing.*;
import java.awt.*;
public class ServiceTablemodel extends Myframelsy {
private AccountDaolsy dao;
public ServiceTablemodel() {
super("服务选择",400,230);
//设置布局管理器为null
getContentPane().setLayout(null);
JLabel lblNewLabel = new JLabel("欢迎光临霄云大酒店!");
lblNewLabel.setHorizontalAlignment(SwingConstants.RIGHT);
lblNewLabel.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 20));
lblNewLabel.setForeground(new Color(143, 0,204));
lblNewLabel.setBounds(100, 40, 200, 20);
getContentPane().add(lblNewLabel);
JButton btnOK = new JButton("订餐服务");
btnOK.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 15));
btnOK.setBounds(40, 85, 97, 50);
getContentPane().add(btnOK);
JButton btnCR = new JButton("公共预约");
btnCR.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 15));
btnCR.setBounds(155, 85, 97, 50);
getContentPane().add(btnCR);
JButton btnCancel = new JButton("其他");
btnCancel.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 15));
btnCancel.setBounds(270, 85, 97, 50);
getContentPane().add(btnCancel);
//注册btnOK的的ActionEvent事件监听器
btnOK.addActionListener(e->{
dao = new AccountDaoImplsy();
Accountlsy accountlsy = dao.findById("220200");
ProductListFrame plf = new ProductListFrame("商品列表",1000,700);
plf.setVisible(true);
setVisible(false);
Mainapplsy.accountlsy = accountlsy;
});
//注册btnCR的的ActionEvent事件监听器
btnCR.addActionListener(e->{
ReserveTablemodel plf = new ReserveTablemodel("商品列表",800,600);
plf.setVisible(true);
setVisible(false);
});
//注册btnCancel的ActionEvent事件监听器
btnCancel.addActionListener(e-> {
//退出系统
JLabel label = new JLabel("服务待开发,请重新选择!");
JOptionPane.showMessageDialog(null, label,"错误",JOptionPane.ERROR_MESSAGE);
});
}
}