📄 freeroomquery.java~20~
字号:
package RoomManagement;
import java.awt.BorderLayout;
import hotelinformationmanagesystem.*;
import javax.swing.JFrame;
import com.borland.jbcl.layout.XYLayout;
import com.borland.jbcl.layout.*;
import javax.swing.JScrollPane;
import javax.swing.JButton;
import javax.swing.JTable;
import ShowTable.TableExample;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JPanel;
import javax.swing.BorderFactory;
import java.awt.Font;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
import javax.swing.JComboBox;
import javax.swing.ButtonGroup;
import javax.swing.JOptionPane;
/**
* <p>Title: 酒店信息管理系统</p>
*
* <p>Description: HotelInformationManageSystem</p>
*
* <p>Copyright: Copyright (c) 2007</p>
*
* <p>Company: JSP</p>
*
* @author 江世澎
* @version 1.0
*/
public class FreeRoomQuery extends JFrame {
JTable jTable1;
TableExample table = new TableExample();
XYLayout xYLayout1 = new XYLayout();
JScrollPane jSPRoomInfo = new JScrollPane();
JButton jBQuery = new JButton();
JButton jBQuit = new JButton();
JPanel jPRoomClass = new JPanel();
JRadioButton jRBRoomClass = new JRadioButton();
JComboBox jCBRoomClass = new JComboBox();
XYLayout xYLayout2 = new XYLayout();
JPanel jPRoomID = new JPanel();
JRadioButton jRBRoomID = new JRadioButton();
JTextField jTFRoomID = new JTextField();
XYLayout xYLayout3 = new XYLayout();
ButtonGroup BGFreeRoomQueryChange = new ButtonGroup();
JPanel jPRoomNum = new JPanel();
JRadioButton jRBRoomNom = new JRadioButton();
JTextField jTFRoomNom = new JTextField();
XYLayout xYLayout4 = new XYLayout();
public FreeRoomQuery() {
try {
jbInit();
} catch (Exception exception) {
exception.printStackTrace();
}
}
private void jbInit() throws Exception {
jTable1 = table.createTable();
getContentPane().setLayout(xYLayout1);
this.setSize(450, 280);
SetFormCenter wcenter = new SetFormCenter();
wcenter.setcenter(this);
this.setResizable(false);
this.setTitle("空闲客房住信息查询");
jBQuit.setFont(new java.awt.Font("宋体", Font.BOLD, 25));
jBQuit.setText("退出");
jBQuery.setFont(new java.awt.Font("宋体", Font.BOLD, 25));
xYLayout1.setWidth(446);
xYLayout1.setHeight(248);
jPRoomClass.setBorder(BorderFactory.createEtchedBorder());
jPRoomClass.setLayout(xYLayout2);
jRBRoomClass.setText("按客房类型查询");
jCBRoomClass.setEnabled(false);
jPRoomID.setBorder(BorderFactory.createEtchedBorder());
jPRoomID.setLayout(xYLayout3);
jRBRoomID.setText("按客房ID查询");
jTFRoomID.setEnabled(false);
jPRoomNum.setBorder(BorderFactory.createEtchedBorder());
jPRoomNum.setLayout(xYLayout4);
jRBRoomNom.setText("按客房床位数查询");
jTFRoomNom.setEnabled(false);
jSPRoomInfo.getViewport().add(jTable1);
this.getContentPane().add(jPRoomClass,
new XYConstraints(5, 174, 217, 34));
jPRoomClass.add(jRBRoomClass, new XYConstraints(5, 3, -1, -1));
jPRoomClass.add(jCBRoomClass, new XYConstraints(124, 3, 84, -1));
jPRoomID.add(jRBRoomID, new XYConstraints(5, 5, -1, -1));
jPRoomID.add(jTFRoomID, new XYConstraints(125, 3, 84, 24));
this.getContentPane().add(jPRoomID, new XYConstraints(5, 210, 217, 35));
jPRoomNum.add(jRBRoomNom, new XYConstraints(2, 3, -1, -1));
jPRoomNum.add(jTFRoomNom, new XYConstraints(132, 3, 79, 23));
this.getContentPane().add(jSPRoomInfo,
new XYConstraints(5, 3, 437, 166));
this.getContentPane().add(jPRoomNum,
new XYConstraints(225, 174, 217, 34));
jBQuery.setText("查询");
table.fetch("select distinct HIMS_RoomInfo.RoomID as 客房ID,Class as 客房类型,RoomArea as 客房面积,BedNo as 床位数,StandardPri as 标准价,RebatePri as 折扣价,place as 客房位置,RoomIntro as 客房简介,Remark as 备注 from HIMS_RoomInfo,HIMS_RoomState WHERE HIMS_RoomInfo.RoomID = HIMS_RoomState.RoomID AND HIMS_RoomState.OnUser in ('2' , '4' , '6')");
BGFreeRoomQueryChange.add(jRBRoomClass); //按客房类型查询
BGFreeRoomQueryChange.add(jRBRoomID); //按客房ID查询
BGFreeRoomQueryChange.add(jRBRoomNom); //按客房床位数查询
this.getContentPane().add(jBQuery, new XYConstraints(227, 210, 105, 35));
this.getContentPane().add(jBQuit, new XYConstraints(346, 210, 96, 35));
jCBRoomClass.setEnabled(false); //按客房类型
jCBRoomClass.addItem(" ");
jCBRoomClass.addItem("标准单人间");
jCBRoomClass.addItem("标准双人间");
jCBRoomClass.addItem("标准四人间");
jCBRoomClass.addItem("家庭间");
jCBRoomClass.addItem("商务间");
jCBRoomClass.addItem("经济间");
jCBRoomClass.addItem("豪华套房");
jTFRoomID.setEnabled(false); //按客房ID
jTFRoomNom.setEnabled(false); //按床位
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -