📄 queryroomframe.java~2~
字号:
package operation;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import java.awt.*;
import javax.swing.JTree;
import javax.swing.JLabel;
import javax.swing.*;
import javax.swing.border.TitledBorder;
import javax.swing.event.TreeExpansionEvent;
import javax.swing.event.TreeExpansionListener;
import javax.swing.event.TreeSelectionEvent;
import javax.swing.event.TreeSelectionListener;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import entity.DBOperatorBean;
import java.sql.ResultSet;
import java.sql.*;
import javax.swing.tree.DefaultMutableTreeNode;
import java.util.Vector;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreePath;
/**
* <p>Title: Hawaii rummery manage</p>
*
* <p>Description: minityperummery manage</p>
*
* <p>Copyright: Copyright (c) 2007</p>
*
* <p>Company: Yue.</p>
*
* @author not attributable
* @version 1.0
*/
public class QueryRoomFrame extends JFrame {
public QueryRoomFrame() {
try {
jbInit();
} catch (Exception ex) {
ex.printStackTrace();
}
}
private void jbInit() throws Exception {
this.getContentPane().setLayout(null);
spTree.getViewport().setBackground(new Color(212, 230, 255));
spTree.setBounds(new Rectangle(42, 136, 230, 293));
this.getContentPane().setBackground(new Color(212, 255, 255));
this.setForeground(Color.cyan);
this.setResizable(false);
this.setTitle("客房查询");
lblTitle.setBackground(new Color(212, 255, 255));
lblTitle.setFont(new java.awt.Font("Dialog", Font.PLAIN, 25));
lblTitle.setForeground(Color.magenta);
lblTitle.setHorizontalAlignment(SwingConstants.CENTER);
lblTitle.setBounds(new Rectangle(243, 6, 215, 37));
lblTree.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
lblTree.setText("请选择房间:");
lblTree.setBounds(new Rectangle(40, 103, 230, 22));
rdoEnable.setBackground(new Color(210, 250, 230));
rdoEnable.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
rdoEnable.setForeground(Color.blue);
rdoEnable.setBorder(titledBorder3);
rdoEnable.setToolTipText("");
rdoEnable.setSelected(true);
rdoEnable.setText("可用房");
rdoUseing.setBackground(new Color(210, 250, 230));
rdoUseing.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
rdoUseing.setForeground(Color.blue);
rdoUseing.setBorder(titledBorder4);
rdoUseing.setText("住客房");
rdoCleaning.setBackground(new Color(210, 250, 230));
rdoCleaning.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
rdoCleaning.setForeground(Color.blue);
rdoCleaning.setBorder(titledBorder5);
rdoCleaning.setText("打扫房");
rdoRepair.setBackground(new Color(210, 250, 230));
rdoRepair.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
rdoRepair.setForeground(Color.blue);
rdoRepair.setBorder(titledBorder6);
rdoRepair.setText("待修房");
queryOption.setBackground(new Color(212, 230, 255));
queryOption.setBorder(BorderFactory.createLoweredBevelBorder());
queryOption.setBounds(new Rectangle(40, 44, 604, 46));
rdoAll.setBackground(new Color(210, 250, 230));
rdoAll.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
rdoAll.setForeground(Color.blue);
rdoAll.setBorder(titledBorder3);
rdoAll.setRolloverEnabled(true);
rdoAll.setSelected(false);
rdoAll.setText("全 部");
lblOptionType.setFont(new java.awt.Font("Dialog", Font.PLAIN, 20));
lblOptionType.setHorizontalAlignment(SwingConstants.LEFT);
lblOptionType.setText("请选择查询类型:");
showInfoPanel.setBackground(new Color(212, 230, 255));
showInfoPanel.setBorder(BorderFactory.createEtchedBorder());
showInfoPanel.setBounds(new Rectangle(295, 132, 348, 295));
showInfoPanel.setLayout(gridLayout1);
lblRoomInfo.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
lblRoomInfo.setBorder(null);
lblRoomInfo.setText("客房信息如下:");
lblRoomInfo.setBounds(new Rectangle(291, 108, 285, 23));
lblRoomNo.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
lblRoomNo.setForeground(Color.magenta);
lblRoomNo.setText("");
root = new DefaultMutableTreeNode("所有客房");
commen = new DefaultMutableTreeNode("普通间客房");
standard = new DefaultMutableTreeNode("标准间客房");
luxury = new DefaultMutableTreeNode("豪华间客房");
lblRoomIntro.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
lblRoomIntro.setForeground(Color.magenta);
lblRoomIntro.setText("");
lblRemark.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
lblRemark.setForeground(Color.magenta);
lblRemark.setText("");
lblRoomType.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
lblRoomType.setForeground(Color.magenta);
lblRoomType.setText("");
lblRoomStandpri.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
lblRoomStandpri.setForeground(Color.magenta);
lblRoomStandpri.setText("");
lblRoomRebate.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
lblRoomRebate.setForeground(Color.magenta);
lblRoomRebate.setText("");
lblOnUse.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
lblOnUse.setForeground(Color.magenta);
lblOnUse.setText("");
lblPlace.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
lblPlace.setForeground(Color.magenta);
lblPlace.setText("");
roomTree.setBackground(UIManager.getColor(
"InternalFrame.activeTitleGradient"));
roomTree.setForeground(Color.magenta);
btnQuery.setBackground(new Color(200, 236, 250));
btnQuery.setForeground(Color.blue);
btnRefresh.setBackground(new Color(200, 236, 255));
btnRefresh.setForeground(Color.blue);
btnreturn.setBackground(new Color(200, 236, 255));
btnreturn.setForeground(Color.blue);
root.add(commen);
root.add(standard);
root.add(luxury);
roomTree = new JTree(root);
btnQuery.setBounds(new Rectangle(164, 455, 100, 35));
btnQuery.setFont(new java.awt.Font("Dialog", Font.PLAIN, 20));
btnQuery.setText("");
btnQuery.addActionListener(new QueryRoomFrame_btnQuery_actionAdapter(this));
btnRefresh.setBounds(new Rectangle(296, 455, 100, 35));
btnRefresh.setFont(new java.awt.Font("Dialog", Font.PLAIN, 20));
btnRefresh.setText("");
btnRefresh.addActionListener(new
QueryRoomFrame_btnRefresh_actionAdapter(this));
btnreturn.setBounds(new Rectangle(426, 456, 101, 35));
btnreturn.setFont(new java.awt.Font("Dialog", Font.PLAIN, 20));
btnreturn.setText("");
btnreturn.addActionListener(new QueryRoomFrame_btnreturn_actionAdapter(this));
roomTree.addTreeSelectionListener(new
QueryRoomFrame_roomTree_treeSelectionAdapter(this));
this.getContentPane().add(queryOption);
queryOption.add(lblOptionType);
queryOption.add(rdoEnable);
queryOption.add(rdoUseing);
queryOption.add(rdoCleaning);
queryOption.add(rdoRepair);
queryOption.add(rdoAll);
this.getContentPane().add(lblTitle);
this.getContentPane().add(showInfoPanel);
this.getContentPane().add(lblRoomInfo);
this.getContentPane().add(spTree);
this.getContentPane().add(lblTree);
this.getContentPane().add(btnQuery);
this.getContentPane().add(btnreturn);
this.getContentPane().add(btnRefresh);
spTree.getViewport().add(roomTree);
this.btnQuery.setIcon(new ImageIcon("image\\frame\\QueryRoomFrame\\query.jpg"));
this.btnRefresh.setIcon(new ImageIcon("image\\frame\\QueryRoomFrame\\refresh.jpg"));
this.btnreturn.setIcon(new ImageIcon("image\\frame\\QueryRoomFrame\\exit.jpg"));
lblTitle.setText("客房查询");
btnGroup.add(rdoRepair);
btnGroup.add(rdoCleaning);
btnGroup.add(rdoUseing);
btnGroup.add(rdoAll);
btnGroup.add(rdoEnable);
showInfoPanel.add(lblRoomNo, null);
showInfoPanel.add(lblRoomType, null);
showInfoPanel.add(lblRoomStandpri, null);
showInfoPanel.add(lblRoomRebate, null);
showInfoPanel.add(lblOnUse, null);
showInfoPanel.add(lblPlace, null);
showInfoPanel.add(lblRoomIntro, null);
showInfoPanel.add(lblRemark, null);
}
JScrollPane spTree = new JScrollPane();
JLabel lblTitle = new JLabel();
JTree roomTree = new JTree();
JLabel lblTree = new JLabel();
JRadioButton rdoEnable = new JRadioButton();
JRadioButton rdoUseing = new JRadioButton();
JRadioButton rdoCleaning = new JRadioButton();
JRadioButton rdoRepair = new JRadioButton();
JPanel queryOption = new JPanel();
ButtonGroup btnGroup = new ButtonGroup();
JRadioButton rdoAll = new JRadioButton();
JLabel lblOptionType = new JLabel();
TitledBorder titledBorder1 = new TitledBorder("");
JPanel showInfoPanel = new JPanel();
JLabel lblRoomInfo = new JLabel();
JLabel lblRoomNo = new JLabel();
DefaultMutableTreeNode root ;
DefaultMutableTreeNode commen ;
DefaultMutableTreeNode standard ;
DefaultMutableTreeNode luxury ;
DBOperatorBean dbo = new DBOperatorBean();
RoomStatusBean roomstatus ;
ResultSet rs = null;
JButton btnQuery = new JButton();
JButton btnRefresh = new JButton();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -