酒店管理系统实现代码
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
//入住
import java.awt.*;
import javax.swing.*;
public class A1 extends JFrame implements WindowListener { //定义各个组件
JFrame frame = new JFrame "入住系统";
JLabel nameLabel = new JLabel"客户姓名";
JLabel idtifyLabel = new JLabel"身份证号";
JLabel roomLabel = new JLabel"入住房号";
JLabel moneyLabel = new JLabel"应付金额";
JTextField nameField = new JTextField;
JTextField idtifyField= new JTextField;
JTextField roomField= new JTextField;
JTextField moneyField= new JTextField;
JButton button1;button2;
/*
public static void mainString args
{
A1 a1 = new A1;
a1.go;
}
*/
public void go{
UpperCaseDocument ucDocument = new UpperCaseDocument;
nameField.setDocumentucDocument;
nameField.setForegroundColor.black;
//frame.addWindowListenerthis;
nameField.addActionListenernew ActionListener
{ public void actionPerformedActionEvent e
{ String username = nameField.getText;
}
};
JComboBox jcb1;//组合框
String itemList = { "现金"; "刷卡" };
jcb1 = new JComboBoxitemList;
jcb1.setSelectedIndex0;
button1=new JButton"确认支付";
button2=new JButton"取消支付";
final JPanel p1 = new JPanel;
p1.addjcb1;
p1.addbutton1;
p1.addbutton2;
p1.setLayoutnew GridLayout3;1;
Border etched = BorderFactory.createEtchedBorder;
Border border = BorderFactory.createTitledBorderetched; "付款方式";
p1.setBorderborder;
button1.addActionListenernew ActionListener
{
public void actionPerformedActionEvent e
{
if e.getActionCommand=="确认支付"
{ JOptionPane.showMessageDialogp1;
"支付成功";"success";
RMATION_MESSAGE;
}
}
}
;
button2.addActionListenernew ActionListener
{
public void actionPerformedActionEvent e
{
if e.getActionCommand=="取消支付"
{ JOptionPane.showMessageDialogp1;
"支付失败";"failure";
RMATION_MESSAGE;
}
}
}
;
idtifyField.addActionListenernew ActionListener { public void actionPerformedActionEvent e { String idtify= idtifyField.getText;
String idtifyword= new Stringidtify;
}
};
roomField.addActionListenernew ActionListener { public void actionPerformedActionEvent e { String room= roomField.getText;
String roomword= new Stringroom;
}
};
moneyField.addActionListenernew ActionListener { public void actionPerformedActionEvent e { String money= moneyField.getText;
String idtifyword= new Stringmoney;