ImageVerifierCode 换一换
格式:DOCX , 页数:81 ,大小:29.52KB ,
资源ID:6279276      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/6279276.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(酒店管理系统实现代码.docx)为本站会员(b****5)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

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

1、酒店管理系统实现代码/入住import java.awt.*;import java.awt.event.*;import javax.swing.*;import javax.swing.border.Border;import javax.swing.text.*;public class A1 extends JFrame implements WindowListener /定义各个组件 JFrame frame = new JFrame (入住系统); JLabel nameLabel = new JLabel(客户姓名); JLabel idtifyLabel = new JLab

2、el(身份证号); 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 main

3、(String args) A1 a1 = new A1(); a1.go(); */ public void go() UpperCaseDocument ucDocument = new UpperCaseDocument(); nameField.setDocument(ucDocument); nameField.setForeground(Color.black); /frame.addWindowListener(this); nameField.addActionListener(new ActionListener() public void actionPerformed(A

4、ctionEvent e) String username = nameField.getText(); ); JComboBox jcb1;/组合框 String itemList = 现金, 刷卡 ; jcb1 = new JComboBox(itemList); jcb1.setSelectedIndex(0); button1=new JButton(确认支付); button2=new JButton(取消支付); final JPanel p1 = new JPanel(); p1.add(jcb1); p1.add(button1); p1.add(button2); p1.se

5、tLayout(new GridLayout(3,1); Border etched = BorderFactory.createEtchedBorder(); Border border = BorderFactory.createTitledBorder(etched, 付款方式); p1.setBorder(border); button1.addActionListener(new ActionListener() public void actionPerformed(ActionEvent e) if (e.getActionCommand()=确认支付) JOptionPane.

6、showMessageDialog(p1, 支付成功,success, JOptionPane.INFORMATION_MESSAGE); ); button2.addActionListener(new ActionListener() public void actionPerformed(ActionEvent e) if (e.getActionCommand()=取消支付) JOptionPane.showMessageDialog(p1, 支付失败,failure, JOptionPane.INFORMATION_MESSAGE); ); idtifyField.addAction

7、Listener(new ActionListener() public void actionPerformed(ActionEvent e) String idtify= idtifyField.getText(); String idtifyword= new String(idtify); ); roomField.addActionListener(new ActionListener() public void actionPerformed(ActionEvent e) String room= roomField.getText(); String roomword= new

8、String(room); ); moneyField.addActionListener(new ActionListener() public void actionPerformed(ActionEvent e) String money= moneyField.getText(); String idtifyword= new String(money); ); /面板labelPanel放标签 JPanel labelPanel = new JPanel(); labelPanel.setLayout(new GridLayout(4,1); labelPanel.add(nameL

9、abel); labelPanel.add(idtifyLabel); labelPanel.add(roomLabel); labelPanel.add(moneyLabel); /面板fieldPanel放文本框 JPanel fieldPanel = new JPanel(); fieldPanel.setLayout(new GridLayout(4,1); fieldPanel.add(nameField); fieldPanel.add(idtifyField); fieldPanel.add(roomField); fieldPanel.add( moneyField); /面板

10、northPanel放面板lanelPanel和面板fieldPanel JPanel northPanel = new JPanel(); northPanel.setLayout(new GridLayout(1,2); northPanel.add(labelPanel); northPanel.add(fieldPanel); Container cp = frame.getContentPane(); cp.add(northPanel,BorderLayout.NORTH);/northPanel放在north cp.add(p1,BorderLayout.SOUTH); fram

11、e.setSize(200,250); frame.setVisible(true); public void windowClosing(WindowEvent e1) System.exit(0); public void windowOpened(WindowEvent e2) public void windowIconified(WindowEvent e3) public void windowDeiconified(WindowEvent e4) public void windowClosed(WindowEvent e5) public void windowActivate

12、d(WindowEvent e6) public void windowDeactivated(WindowEvent e7) class UpperCaseDocument extends PlainDocument public void insertString(int offset, String string, AttributeSet attributeSet) throws BadLocationException string = string.toUpperCase(); super.insertString(offset,string, attributeSet); 第二个

13、:/退房import java.awt.*;import java.awt.event.*;import javax.swing.*;import javax.swing.border.Border;import javax.swing.text.*;public class A2 extends JFrame /定义各个组件 JFrame frame = new JFrame (退房系统); JLabel nameLabel = new JLabel(客户姓名); JLabel idtifyLabel = new JLabel(身份证号); JLabel roomLabel = new JL

14、abel(退房号); JLabel timeLabel = new JLabel(退房时间); JTextField nameField = new JTextField(); JTextField idtifyField= new JTextField(); JTextField roomField= new JTextField(); JTextField timeField= new JTextField(); JButton button1,button2; /JTextArea ta = new JTextArea(5,20); /* public static void main(

15、String args) A2 a2 = new A2(); a2.go(); */ public void go() UpperCaseDocument ucDocument = new UpperCaseDocument(); nameField.setDocument(ucDocument); nameField.setForeground(Color.black); nameField.addActionListener(new ActionListener() public void actionPerformed(ActionEvent e) String username = n

16、ameField.getText(); ); button1=new JButton(是); button2=new JButton(否); final JPanel p1 = new JPanel(); p1.add(button1); p1.add(button2); p1.setLayout(new GridLayout(2,1); Border etched = BorderFactory.createEtchedBorder(); Border border = BorderFactory.createTitledBorder(etched, 是否结清消费账单); p1.setBor

17、der(border); button1.addActionListener(new ActionListener() public void actionPerformed(ActionEvent e) if (e.getActionCommand()=是) JOptionPane.showMessageDialog(p1, 谢谢您的大力支持!,success, JOptionPane.INFORMATION_MESSAGE); ); button2.addActionListener(new ActionListener() public void actionPerformed(Acti

18、onEvent e) if (e.getActionCommand()=否) JOptionPane.showMessageDialog(p1, 请结清消费账单,failure, JOptionPane.INFORMATION_MESSAGE); ); idtifyField.addActionListener(new ActionListener() public void actionPerformed(ActionEvent e) String idtify= idtifyField.getText(); String idtifyword= new String(idtify); );

19、 roomField.addActionListener(new ActionListener() public void actionPerformed(ActionEvent e) String room= roomField.getText(); String roomword= new String(room); ); timeField.addActionListener(new ActionListener() public void actionPerformed(ActionEvent e) String time= timeField.getText(); String ti

20、meword= new String(time); ); /面板labelPanel放标签 JPanel labelPanel = new JPanel(); labelPanel.setLayout(new GridLayout(4,1); labelPanel.add(nameLabel); labelPanel.add(idtifyLabel); labelPanel.add(roomLabel); labelPanel.add(timeLabel); /面板fieldPanel放文本框 JPanel fieldPanel = new JPanel(); fieldPanel.setLa

21、yout(new GridLayout(4,1); fieldPanel.add(nameField); fieldPanel.add(idtifyField); fieldPanel.add(roomField); fieldPanel.add( timeField); /面板northPanel放面板lanelPanel和面板fieldPanel JPanel northPanel = new JPanel(); northPanel.setLayout(new GridLayout(1,2); northPanel.add(labelPanel); northPanel.add(fiel

22、dPanel); Container cp = frame.getContentPane(); cp.add(northPanel,BorderLayout.NORTH);/northPanel放在north cp.add(p1,BorderLayout.SOUTH); / frame.pack(); frame.setSize(200,230); frame.setVisible(true); class UpperCaseDocument extends PlainDocument public void insertString(int offset, String string, At

23、tributeSet attributeSet) throws BadLocationException string = string.toUpperCase(); super.insertString(offset,string, attributeSet); 第三个:/客房预订import java.awt.*;import java.awt.event.*;import javax.swing.*;import javax.swing.border.Border;import javax.swing.text.*;public class A3 extends JFrame /定义各个

24、组件 JFrame frame = new JFrame (客房预订); JLabel nameLabel = new JLabel(预订人姓名); JLabel numberLabel = new JLabel(手机号); JTextField nameField = new JTextField(); JTextField numberField= new JTextField(); JRadioButton rb1 = new JRadioButton(来电预订); JRadioButton rb2 = new JRadioButton(电话预订); JRadioButton rb3 =

25、 new JRadioButton(电传预订); JRadioButton rb4 = new JRadioButton(传真预订); JRadioButton rb5 = new JRadioButton(信函预订); JButton button1,button2; /* * public static void main(String args) A3 a3 = new A3(); a3.go(); */ public void go() UpperCaseDocument ucDocument = new UpperCaseDocument(); nameField.setDocume

26、nt(ucDocument); nameField.setForeground(Color.black); nameField.addActionListener(new ActionListener() public void actionPerformed(ActionEvent e) String username = nameField.getText(); ); JComboBox jcb1;/组合框 String itemList = 总统套房, 双人间,单人间 ; jcb1 = new JComboBox(itemList); jcb1.setSelectedIndex(0);

27、button1=new JButton(是); button2=new JButton(否); final JPanel p1 = new JPanel(); p1.add(jcb1); p1.add(button1); p1.add(button2); p1.setLayout(new GridLayout(3,1); Border etched = BorderFactory.createEtchedBorder(); Border border = BorderFactory.createTitledBorder(etched, 预订房类型); p1.setBorder(border); button1.addActionListener(new ActionListener() public void actionPerformed(ActionEvent e) if (e.getActionCommand()=是) JOptionPane.showMe

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1