酒店管理系统实现代码.docx

上传人:b****8 文档编号:8946836 上传时间:2023-05-16 格式:DOCX 页数:94 大小:30.83KB
下载 相关 举报
酒店管理系统实现代码.docx_第1页
第1页 / 共94页
酒店管理系统实现代码.docx_第2页
第2页 / 共94页
酒店管理系统实现代码.docx_第3页
第3页 / 共94页
酒店管理系统实现代码.docx_第4页
第4页 / 共94页
酒店管理系统实现代码.docx_第5页
第5页 / 共94页
酒店管理系统实现代码.docx_第6页
第6页 / 共94页
酒店管理系统实现代码.docx_第7页
第7页 / 共94页
酒店管理系统实现代码.docx_第8页
第8页 / 共94页
酒店管理系统实现代码.docx_第9页
第9页 / 共94页
酒店管理系统实现代码.docx_第10页
第10页 / 共94页
酒店管理系统实现代码.docx_第11页
第11页 / 共94页
酒店管理系统实现代码.docx_第12页
第12页 / 共94页
酒店管理系统实现代码.docx_第13页
第13页 / 共94页
酒店管理系统实现代码.docx_第14页
第14页 / 共94页
酒店管理系统实现代码.docx_第15页
第15页 / 共94页
酒店管理系统实现代码.docx_第16页
第16页 / 共94页
酒店管理系统实现代码.docx_第17页
第17页 / 共94页
酒店管理系统实现代码.docx_第18页
第18页 / 共94页
酒店管理系统实现代码.docx_第19页
第19页 / 共94页
酒店管理系统实现代码.docx_第20页
第20页 / 共94页
亲,该文档总共94页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

酒店管理系统实现代码.docx

《酒店管理系统实现代码.docx》由会员分享,可在线阅读,更多相关《酒店管理系统实现代码.docx(94页珍藏版)》请在冰点文库上搜索。

酒店管理系统实现代码.docx

酒店管理系统实现代码

//入住

importjava.awt.*;

importjava.awt.event.*;

importjavax.swing.*;

importjavax.swing.border.Border;

importjavax.swing.text.*;

publicclassA1extendsJFrameimplementsWindowListener{

//定义各个组件

JFrameframe=newJFrame("入住系统");

JLabelnameLabel=newJLabel("客户姓名");

JLabelidtifyLabel=newJLabel("身份证号");

JLabelroomLabel=newJLabel("入住房号");

JLabelmoneyLabel=newJLabel("应付金额");

JTextFieldnameField=newJTextField();

JTextFieldidtifyField=newJTextField();

JTextFieldroomField=newJTextField();

JTextFieldmoneyField=newJTextField();

JButtonbutton1,button2;

/*

publicstaticvoidmain(Stringargs[])

{

A1a1=newA1();

a1.go();

}

*/

publicvoidgo(){

UpperCaseDocumentucDocument=newUpperCaseDocument();

nameField.setDocument(ucDocument);

nameField.setForeground(Color.black);

//frame.addWindowListener(this);

nameField.addActionListener(newActionListener()

{publicvoidactionPerformed(ActionEvente)

{Stringusername=nameField.getText();

}

});

JComboBoxjcb1;//组合框

String[]itemList={"现金","刷卡"};

jcb1=newJComboBox(itemList);

jcb1.setSelectedIndex(0);

button1=newJButton("确认支付");

button2=newJButton("取消支付");

finalJPanelp1=newJPanel();

p1.add(jcb1);

p1.add(button1);

p1.add(button2);

p1.setLayout(newGridLayout(3,1));

Borderetched=BorderFactory.createEtchedBorder();

Borderborder=BorderFactory.createTitledBorder(etched,"付款方式");

p1.setBorder(border);

button1.addActionListener(newActionListener()

{

publicvoidactionPerformed(ActionEvente)

{

if(e.getActionCommand()=="确认支付")

{JOptionPane.showMessageDialog(p1,

"支付成功","success",

JOptionPane.INFORMATION_MESSAGE);

}

}

}

);

button2.addActionListener(newActionListener()

{

publicvoidactionPerformed(ActionEvente)

{

if(e.getActionCommand()=="取消支付")

{JOptionPane.showMessageDialog(p1,

"支付失败","failure",

JOptionPane.INFORMATION_MESSAGE);

}

}

}

);

idtifyField.addActionListener(newActionListener()

{publicvoidactionPerformed(ActionEvente)

{Stringidtify=idtifyField.getText();

Stringidtifyword=newString(idtify);

}

});

roomField.addActionListener(newActionListener()

{publicvoidactionPerformed(ActionEvente)

{Stringroom=roomField.getText();

Stringroomword=newString(room);

}

});

moneyField.addActionListener(newActionListener()

{publicvoidactionPerformed(ActionEvente)

{Stringmoney=moneyField.getText();

Stringidtifyword=newString(money);

}

});

//面板labelPanel放标签

JPanellabelPanel=newJPanel();

labelPanel.setLayout(newGridLayout(4,1));

labelPanel.add(nameLabel);

labelPanel.add(idtifyLabel);

labelPanel.add(roomLabel);

labelPanel.add(moneyLabel);

//面板fieldPanel放文本框

JPanelfieldPanel=newJPanel();

fieldPanel.setLayout(newGridLayout(4,1));

fieldPanel.add(nameField);

fieldPanel.add(idtifyField);

fieldPanel.add(roomField);

fieldPanel.add(moneyField);

//面板northPanel放面板lanelPanel和面板fieldPanel

JPanelnorthPanel=newJPanel();

northPanel.setLayout(newGridLayout(1,2));

northPanel.add(labelPanel);

northPanel.add(fieldPanel);

 

Containercp=frame.getContentPane();

cp.add(northPanel,BorderLayout.NORTH);//northPanel放在north

cp.add(p1,BorderLayout.SOUTH);

frame.setSize(200,250);

frame.setVisible(true);

}

publicvoidwindowClosing(WindowEvente1){

System.exit(0);

}

publicvoidwindowOpened(WindowEvente2){

}

publicvoidwindowIconified(WindowEvente3){

}

publicvoidwindowDeiconified(WindowEvente4){

}

publicvoidwindowClosed(WindowEvente5){

}

publicvoidwindowActivated(WindowEvente6){

}

publicvoidwindowDeactivated(WindowEvente7){

}

}

 

classUpperCaseDocumentextendsPlainDocument

{publicvoidinsertString(intoffset,

Stringstring,AttributeSetattributeSet)

throwsBadLocationException

{string=string.toUpperCase();

super.insertString(offset,string,attributeSet);

}

}

 

第二个:

//退房

importjava.awt.*;

importjava.awt.event.*;

importjavax.swing.*;

importjavax.swing.border.Border;

importjavax.swing.text.*;

publicclassA2extendsJFrame{

//定义各个组件

JFrameframe=newJFrame("退房系统");

JLabelnameLabel=newJLabel("客户姓名");

JLabelidtifyLabel=newJLabel("身份证号");

JLabelroomLabel=newJLabel("退房号");

JLabeltimeLabel=newJLabel("退房时间");

JTextFieldnameField=newJTextField();

JTextFieldidtifyField=newJTextField();

JTextFieldroomField=newJTextField();

JTextFieldtimeField=newJTextField();

JButtonbutton1,button2;

//JTextAreata=newJTextArea(5,20);

/*

publicstaticvoidmain(Stringargs[])

{

A2a2=newA2();

a2.go();

}

*/

publicvoidgo(){

UpperCaseDocumentucDocument=newUpperCaseDocument();

nameField.setDocument(ucDocument);

nameField.setForeground(Color.black);

nameField.addActionListener(newActionListener()

{publicvoidactionPerformed(ActionEvente)

{Stringusername=nameField.getText();

}

});

button1=newJButton("是");

button2=newJButton("否");

finalJPanelp1=newJPanel();

p1.add(button1);

p1.add(button2);

p1.setLayout(newGridLayout(2,1));

Borderetched=BorderFactory.createEtchedBorder();

Borderborder=BorderFactory.createTitledBorder(etched,"是否结清消费账单");

p1.setBorder(border);

button1.addActionListener(newActionListener()

{

publicvoidactionPerformed(ActionEvente)

{

if(e.getActionCommand()=="是")

{JOptionPane.showMessageDialog(p1,

"谢谢您的大力支持!

","success",

JOptionPane.INFORMATION_MESSAGE);

}

}

}

);

button2.addActionListener(newActionListener()

{

publicvoidactionPerformed(ActionEvente)

{

if(e.getActionCommand()=="否")

{JOptionPane.showMessageDialog(p1,

"请结清消费账单","failure",

JOptionPane.INFORMATION_MESSAGE);

}

}

}

);

idtifyField.addActionListener(newActionListener()

{publicvoidactionPerformed(ActionEvente)

{Stringidtify=idtifyField.getText();

Stringidtifyword=newString(idtify);

}

});

roomField.addActionListener(newActionListener()

{publicvoidactionPerformed(ActionEvente)

{Stringroom=roomField.getText();

Stringroomword=newString(room);

}

});

timeField.addActionListener(newActionListener()

{publicvoidactionPerformed(ActionEvente)

{Stringtime=timeField.getText();

Stringtimeword=newString(time);

}

});

//面板labelPanel放标签

JPanellabelPanel=newJPanel();

labelPanel.setLayout(newGridLayout(4,1));

labelPanel.add(nameLabel);

labelPanel.add(idtifyLabel);

labelPanel.add(roomLabel);

labelPanel.add(timeLabel);

//面板fieldPanel放文本框

JPanelfieldPanel=newJPanel();

fieldPanel.setLayout(newGridLayout(4,1));

fieldPanel.add(nameField);

fieldPanel.add(idtifyField);

fieldPanel.add(roomField);

fieldPanel.add(timeField);

//面板northPanel放面板lanelPanel和面板fieldPanel

JPanelnorthPanel=newJPanel();

northPanel.setLayout(newGridLayout(1,2));

northPanel.add(labelPanel);

northPanel.add(fieldPanel);

Containercp=frame.getContentPane();

cp.add(northPanel,BorderLayout.NORTH);//northPanel放在north

cp.add(p1,BorderLayout.SOUTH);

//frame.pack();

frame.setSize(200,230);

frame.setVisible(true);

}

}

 

classUpperCaseDocumentextendsPlainDocument

{publicvoidinsertString(intoffset,

Stringstring,AttributeSetattributeSet)

throwsBadLocationException

{string=string.toUpperCase();

super.insertString(offset,string,attributeSet);

}

}

 

第三个:

//客房预订

importjava.awt.*;

importjava.awt.event.*;

importjavax.swing.*;

importjavax.swing.border.Border;

importjavax.swing.text.*;

publicclassA3extendsJFrame{

//定义各个组件

JFrameframe=newJFrame("客房预订");

JLabelnameLabel=newJLabel("预订人姓名");

JLabelnumberLabel=newJLabel("手机号");

JTextFieldnameField=newJTextField();

JTextFieldnumberField=newJTextField();

JRadioButtonrb1=newJRadioButton("来电预订");

JRadioButtonrb2=newJRadioButton("电话预订");

JRadioButtonrb3=newJRadioButton("电传预订");

JRadioButtonrb4=newJRadioButton("传真预订");

JRadioButtonrb5=newJRadioButton("信函预订");

JButtonbutton1,button2;

/*

*publicstaticvoidmain(Stringargs[])

{

A3a3=newA3();

a3.go();

}

*/

publicvoidgo(){

UpperCaseDocumentucDocument=newUpperCaseDocument();

nameField.setDocument(ucDocument);

nameField.setForeground(Color.black);

nameField.addActionListener(newActionListener()

{publicvoidactionPerformed(ActionEvente)

{Stringusername=nameField.getText();

}

});

JComboBoxjcb1;//组合框

String[]itemList={"总统套房","双人间","单人间"};

jcb1=newJComboBox(itemList);

jcb1.setSelectedIndex(0);

button1=newJButton("是");

button2=newJButton("否");

finalJPanelp1=newJPanel();

p1.add(jcb1);

p1.add(button1);

p1.add(button2);

p1.setLayout(newGridLayout(3,1));

Borderetched=BorderFactory.createEtchedBorder();

Borderborder=BorderFactory.createTitledBorder(etched,"预订房类型");

p1.setBorder(border);

button1.addActionListener(newActionListener()

{

publicvoidactionPerformed(ActionEvente)

{

if(e.getActionCommand()=="是")

{JOp

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 经管营销 > 经济市场

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2