📄 teabar.java
字号:
package teabar;
import client.*;
import java.io.*;
import java.util.Date;
import java.awt.event.*;
import java.util.GregorianCalendar;
public class TeaBar extends javax.swing.JFrame {
private Date date;
private GregorianCalendar calendar;
private String strTime,strData,strStatus;
private String account;
private Hall hall;
public TeaBar(String account_,Hall hall_) {
initComponents();
this.setLocation(250,250);
account=account_;
hall=hall_;
}
// <editor-fold defaultstate="collapsed" desc=" 生成的代码 ">//GEN-BEGIN:initComponents
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jButton_menu = new javax.swing.JButton();
jButton_seat = new javax.swing.JButton();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
jButton_exit = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
jPanel1.setBackground(new java.awt.Color(204, 204, 204));
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
jPanel1.setForeground(new java.awt.Color(153, 102, 255));
jLabel1.setBackground(new java.awt.Color(153, 244, 51));
jLabel1.setFont(new java.awt.Font("楷体_GB2312", 0, 20));
jLabel1.setForeground(new java.awt.Color(153, 102, 255));
jLabel1.setText("\u6b22\u8fce\u5149\u4e34\u66d9\u5149\u8336\u9910\u5385");
jButton_menu.setForeground(new java.awt.Color(153, 102, 255));
jButton_menu.setText("\u8ba2\u9910 ");
jButton_menu.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton_menuMouseClicked(evt);
}
});
jButton_seat.setForeground(new java.awt.Color(153, 102, 255));
jButton_seat.setText("\u8ba2\u5ea7");
jButton_seat.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton_seatMouseClicked(evt);
}
});
jLabel5.setForeground(new java.awt.Color(153, 102, 255));
jLabel5.setText("\u65e5\u671f:");
jLabel6.setForeground(new java.awt.Color(153, 102, 255));
jLabel6.setText("jLabel6");
jLabel6.setText(strData());
jLabel7.setForeground(new java.awt.Color(153, 102, 255));
jLabel7.setText("\u65f6\u95f4:");
jLabel8.setForeground(new java.awt.Color(153, 102, 255));
jLabel8.setText("jLabel8");
jLabel8.setText(strTime());
jButton_exit.setForeground(new java.awt.Color(153, 102, 255));
jButton_exit.setText("\u9000\u51fa");
jButton_exit.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton_exitMouseClicked(evt);
}
});
org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel1Layout.createSequentialGroup()
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanel1Layout.createSequentialGroup()
.add(101, 101, 101)
.add(jButton_menu, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 63, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(53, 53, 53)
.add(jButton_seat, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 63, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 53, Short.MAX_VALUE)
.add(jButton_exit)
.add(14, 14, 14))
.add(jPanel1Layout.createSequentialGroup()
.add(jLabel5)
.add(21, 21, 21)
.add(jLabel6, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 75, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jLabel7)
.add(25, 25, 25)
.add(jLabel8)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 161, Short.MAX_VALUE)))
.add(142, 142, 142))
.add(jPanel1Layout.createSequentialGroup()
.add(157, 157, 157)
.add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 202, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addContainerGap(187, Short.MAX_VALUE))
);
jPanel1Layout.linkSize(new java.awt.Component[] {jButton_menu, jButton_seat}, org.jdesktop.layout.GroupLayout.HORIZONTAL);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel5)
.add(jLabel7)
.add(jLabel8)
.add(jLabel6))
.add(46, 46, 46)
.add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 43, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(31, 31, 31)
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jButton_menu, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 23, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(jButton_seat, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 23, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(jButton_exit))
.add(97, 97, 97))
);
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.addContainerGap()
.add(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
.addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 294, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void jButton_seatMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton_seatMouseClicked
new Seat(account,hall).setVisible(true);
hall=null;
this.dispose();
}//GEN-LAST:event_jButton_seatMouseClicked
private void jButton_menuMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton_menuMouseClicked
new Menu(account,strData,strTime,hall).setVisible(true);
hall=null;
this.dispose();
}//GEN-LAST:event_jButton_menuMouseClicked
private void jButton_exitMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton_exitMouseClicked
hall.setVisible(true);
hall=null;
this.dispose();
}//GEN-LAST:event_jButton_exitMouseClicked
public String strTime(){
date=new Date();
calendar=new GregorianCalendar();
calendar.setTime(date);
strTime=calendar.get(calendar.HOUR)+":"+ calendar.get(calendar.MINUTE)+":"+ calendar.get(calendar.SECOND);
return strTime;
}
public String strData(){
date=new Date();
calendar=new GregorianCalendar();
calendar.setTime(date);
strData=(calendar.get(calendar.MONTH)+1)+" /"+calendar.get(calendar.DATE)+" /"+calendar.get(calendar.YEAR);
return strData;
}
// 变量声明 - 不进行修改//GEN-BEGIN:variables
private javax.swing.JButton jButton_exit;
private javax.swing.JButton jButton_menu;
private javax.swing.JButton jButton_seat;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JPanel jPanel1;
// 变量声明结束//GEN-END:variables
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -