⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 recordwalkinframe.java~13~

📁 这个一个餐厅预定系统,可实现查询目前餐厅预订情况,实现餐桌预订以及就餐时为顾客调节餐桌的情况.
💻 JAVA~13~
字号:
package bookingsystem;

import java.awt.*;

import javax.swing.*;
import java.awt.BorderLayout;
import com.borland.jbcl.layout.XYLayout;
import com.borland.jbcl.layout.*;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.SimpleDateFormat;

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2007</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class RecordWalkInFrame extends myFrame {
    String tempPredate ;
    JLabel jLabel1 = new JLabel();
    XYLayout xYLayout1 = new XYLayout();
    JLabel jLabel2 = new JLabel();
    JLabel jLabel4 = new JLabel();
    JLabel jLabel5 = new JLabel();
    JTextField jTextField1 = new JTextField();
    JTextField jTextField2 = new JTextField();
    JButton jButton1 = new JButton();
    JButton jButton2 = new JButton();
    private ResFrame resFrame;
    JComboBox jComboBox1 = new JComboBox();

    public RecordWalkInFrame(ResFrame r) {
        super();
        this.resFrame = r;
        try {
            jbInit();
        } catch (Exception exception) {
            exception.printStackTrace();
        }
    }

    private void jbInit() throws Exception {
        this.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
        getContentPane().setLayout(xYLayout1);
        jLabel1.setFont(new java.awt.Font("宋体", Font.PLAIN, 20));
        jLabel1.setText("记录到达");
        jButton1.addActionListener(new RecordWalkInFrame_jButton1_actionAdapter(this));
        jButton2.addActionListener(new RecordWalkInFrame_jButton2_actionAdapter(this));
        jTextField2.setEditable(false);
        this.getContentPane().add(jLabel1, new XYConstraints(143, 19, 99, 41));
        jButton2.setText("取消");
        jButton1.setText("确定");
        xYLayout1.setWidth(400);
        xYLayout1.setHeight(328);
        jLabel5.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
        jLabel5.setText("餐桌编号");
        jLabel4.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
        jLabel4.setText("到达时间");
        jLabel2.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
        jLabel2.setText("人数");
        this.getContentPane().add(jTextField1,
                                  new XYConstraints(142, 79, 138, -1));
        this.getContentPane().add(jLabel4, new XYConstraints(52, 133, -1, -1));
        this.getContentPane().add(jLabel5, new XYConstraints(52, 180, -1, 21));
        this.getContentPane().add(jLabel2, new XYConstraints(52, 75, 41, 28));
        this.getContentPane().add(jTextField2,
                                  new XYConstraints(142, 130, 138, -1));
        this.getContentPane().add(jButton1, new XYConstraints(73, 249, 73, -1));
        this.getContentPane().add(jButton2, new XYConstraints(230, 249, 69, -1));
        this.getContentPane().add(jComboBox1,
                                  new XYConstraints(142, 179, 90, -1));

        long nCurrentTime = System.currentTimeMillis();
       java.util.Date date = new java.util.Date(nCurrentTime);
       SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm");
       tempPredate = df.format(date);
       jTextField2.setText(tempPredate);

       fillFreeTable();

    }

    public void fillFreeTable()
    {
        for(int i = 0 ;i<9;i++)
        {
            if(this.resFrame.statelist[i].equalsIgnoreCase("free"))
            {
                String tempTalno = "00"+i;
                jComboBox1.addItem(tempTalno);
            }
        }
    }

    public void jButton1_actionPerformed(ActionEvent e) {
         int tempCovers = Integer.parseInt(jTextField1.getText());

         String tempTalno = jComboBox1.getSelectedItem().toString();
         WALK_IN walk = new WALK_IN(tempCovers,tempPredate,tempTalno);
         walk.addWalk();
         this.resFrame.btnDisplay_actionPerformed(e);
         this.resFrame.setEnabled(true);
         this.dispose();
    }

    public void jButton2_actionPerformed(ActionEvent e) {
         this.resFrame.setEnabled(true);
         this.dispose();
    }
}


class RecordWalkInFrame_jButton2_actionAdapter implements ActionListener {
    private RecordWalkInFrame adaptee;
    RecordWalkInFrame_jButton2_actionAdapter(RecordWalkInFrame adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.jButton2_actionPerformed(e);
    }
}


class RecordWalkInFrame_jButton1_actionAdapter implements ActionListener {
    private RecordWalkInFrame adaptee;
    RecordWalkInFrame_jButton1_actionAdapter(RecordWalkInFrame adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.jButton1_actionPerformed(e);
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -