📄 start.java~25~
字号:
package prj;
import java.awt.BorderLayout;
import javax.swing.JPanel;
import javax.swing.JLabel;
import java.awt.*;
import javax.swing.JComboBox;
import javax.swing.JTextField;
import javax.swing.JButton;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JOptionPane;
/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2007</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class Start extends JPanel {
public Start() {
try {
jbInit();
} catch (Exception exception) {
exception.printStackTrace();
}
}
private void jbInit() throws Exception {
this.setLayout(null);
jLabel1.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
jLabel1.setText("卡 号:");
jLabel1.setBounds(new Rectangle(74, 79, 74, 33));
jLabel2.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
jLabel2.setText("密 码:");
jLabel2.setBounds(new Rectangle(74, 126, 68, 33));
jLabel3.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
jLabel3.setText("上机时间:");
jLabel3.setBounds(new Rectangle(74, 175, 69, 33));
jLabel4.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
jLabel4.setText("机器号码:");
jLabel4.setBounds(new Rectangle(74, 31, 76, 33));
jiqihao.setBounds(new Rectangle(202, 36, 102, 23));
mima.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
//mima.setText("");
mima.setBounds(new Rectangle(199, 130, 109, 25));
starttime.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
//starttime.setText("");
starttime.setBounds(new Rectangle(199, 179, 157, 25));
kahao.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
//kahao.setText("");
kahao.setBounds(new Rectangle(199, 83, 109, 25));
jButton1.setBounds(new Rectangle(215, 235, 73, 32));
jButton1.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
jButton1.setText("重置");
jButton1.addActionListener(new Start_jButton1_actionAdapter(this));
btnQueren.setBounds(new Rectangle(88, 235, 73, 32));
btnQueren.setFont(new java.awt.Font("Dialog", Font.PLAIN, 15));
btnQueren.setText("确认");
btnQueren.addActionListener(new Start_btnQueren_actionAdapter(this));
jiqihao.addItem("1");
jiqihao.addItem("2");
jiqihao.addItem("3");
jiqihao.addItem("4");
jiqihao.addItem("5");
jiqihao.addItem("6");
jiqihao.addItem("7");
jiqihao.addItem("8");
this.add(jLabel1);
this.add(jLabel2);
this.add(jLabel3);
this.add(kahao);
this.add(mima);
this.add(starttime);
this.add(jiqihao);
this.add(jLabel4);
this.add(jButton1);
this.add(btnQueren);
}
JLabel jLabel1 = new JLabel();
JLabel jLabel2 = new JLabel();
JLabel jLabel3 = new JLabel();
JLabel jLabel4 = new JLabel();
JComboBox jiqihao = new JComboBox();
JTextField mima = new JTextField();
JTextField starttime = new JTextField();
JTextField kahao = new JTextField();
JButton jButton1 = new JButton();
JButton btnQueren = new JButton();
public Card cardplay(){
Card cardl = new Card();
return cardl;
}
public void jButton1_actionPerformed(ActionEvent e) {
kahao.setText("");
mima.setText("");
time time = new time();
time.play();
starttime.setText(time.year + "-" + time.month + "-" + time.day + " " +
time.hour + ":" + time.minute + ":" + time.second);
}
public void btnQueren_actionPerformed(ActionEvent e) {
cardplay().setId(kahao.getText());
cardplay().setPassword(mima.getText());
DB db = new DB();
if( db.panduan() ){
this.setVisible(false);
JOptionPane.showMessageDialog(null,"你登录成功! 欢迎来到派对网吧!");
}
else{
this.setVisible(true);
}
}
}
class Start_btnQueren_actionAdapter implements ActionListener {
private Start adaptee;
Start_btnQueren_actionAdapter(Start adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.btnQueren_actionPerformed(e);
}
}
class Start_jButton1_actionAdapter implements ActionListener {
private Start adaptee;
Start_jButton1_actionAdapter(Start adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton1_actionPerformed(e);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -