?? recordwalkinframe.java~18~
字號:
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("記錄到達(dá)");
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("到達(dá)時間");
jLabel2.setFont(new java.awt.Font("宋體", Font.PLAIN, 14));
jLabel2.setText("人數(shù)");
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"))
{
int j = i+1;
String tempTalno = "00"+j;
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);
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -