📄 enterframe.java
字号:
package com.cn.szhaccp.landing;
/*
* EnterFrame.java
*
* Created on 2007年4月28日, 上午10:56
*/
import java.awt.Cursor;
import javax.swing.JFrame;
/**
*
* @author Admin
*/
public class EnterFrame extends javax.swing.JFrame {
/** Creates new form EnterFrame */
public EnterFrame() {
this.setResizable(false);
ToCenter tc = new ToCenter();
vu = new ValidateUser();
initComponents();
tc.SetFrameToCenter(this);
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc=" 生成的代码 ">//GEN-BEGIN:initComponents
private void initComponents() {
Welecome = new javax.swing.JLabel();
UserID = new javax.swing.JLabel();
password = new javax.swing.JLabel();
userIDText = new javax.swing.JTextField();
passwordText = new javax.swing.JPasswordField();
login = new javax.swing.JButton();
cancel = new javax.swing.JButton();
register = new javax.swing.JLabel();
change = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("\u8bf7\u767b\u9646");
Welecome.setText("<html><h2><font color = 'blue'>\u6b22\u8fce\u4f7f\u7528\u8d44\u4ea7\u7ba1\u7406\u7cfb\u7edf</font></h2></html>");
UserID.setText("\u7528\u6237ID:");
password.setText("\u5bc6 \u7801:");
login.setText("\u767b \u9646");
login.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
loginActionPerformed(evt);
}
});
cancel.setText("\u53d6 \u6d88");
cancel.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cancelActionPerformed(evt);
}
});
register.setText("<html><font color = 'red'>\u70b9\u6b64\u6ce8\u518c</font></html>");
register.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
public void mouseMoved(java.awt.event.MouseEvent evt) {
registerMouseMoved(evt);
}
});
register.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
registerMouseClicked(evt);
}
public void mouseExited(java.awt.event.MouseEvent evt) {
registerMouseExited(evt);
}
});
change.setText("<html><font color = 'red'>\u4fee\u6539\u5bc6\u7801</font></html>");
change.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
public void mouseMoved(java.awt.event.MouseEvent evt) {
changeMouseMoved(evt);
}
});
change.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
changeMouseClicked(evt);
}
public void mouseExited(java.awt.event.MouseEvent evt) {
changeMouseExited(evt);
}
});
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
.add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup()
.add(62, 62, 62)
.add(login)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 55, Short.MAX_VALUE)
.add(cancel)
.add(23, 23, 23))
.add(layout.createSequentialGroup()
.addContainerGap(43, Short.MAX_VALUE)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(UserID)
.add(password))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
.add(passwordText)
.add(userIDText, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 125, Short.MAX_VALUE))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(change)
.add(register))))
.add(34, 34, 34))
.add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
.addContainerGap(60, Short.MAX_VALUE)
.add(Welecome)
.add(50, 50, 50))
);
layout.linkSize(new java.awt.Component[] {cancel, login}, org.jdesktop.layout.GroupLayout.HORIZONTAL);
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(21, 21, 21)
.add(Welecome)
.add(24, 24, 24)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(register)
.add(UserID)
.add(userIDText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.add(22, 22, 22)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(change)
.add(password)
.add(passwordText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.add(28, 28, 28)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(login, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 23, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(cancel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 23, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.addContainerGap(31, Short.MAX_VALUE))
);
layout.linkSize(new java.awt.Component[] {cancel, login}, org.jdesktop.layout.GroupLayout.VERTICAL);
layout.linkSize(new java.awt.Component[] {passwordText, userIDText}, org.jdesktop.layout.GroupLayout.VERTICAL);
pack();
}// </editor-fold>//GEN-END:initComponents
private void changeMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_changeMouseClicked
// TODO 将在此处添加您的处理代码:
javax.swing.JDialog.setDefaultLookAndFeelDecorated(true);
new ChangeFrame(EnterFrame.this,true).setVisible(true);
}//GEN-LAST:event_changeMouseClicked
private void registerMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_registerMouseClicked
// TODO 将在此处添加您的处理代码:
javax.swing.JDialog.setDefaultLookAndFeelDecorated(true);
new RegisterFrame(EnterFrame.this,true).setVisible(true);
}//GEN-LAST:event_registerMouseClicked
private void loginActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_loginActionPerformed
// TODO 将在此处添加您的处理代码:
vu.Validate(EnterFrame.this,userIDText.getText(),String.valueOf(passwordText.getPassword()));
}//GEN-LAST:event_loginActionPerformed
private void changeMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_changeMouseExited
// TODO 将在此处添加您的处理代码:
setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
}//GEN-LAST:event_changeMouseExited
private void changeMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_changeMouseMoved
// TODO 将在此处添加您的处理代码:
setCursor(new Cursor(Cursor.HAND_CURSOR));
}//GEN-LAST:event_changeMouseMoved
private void registerMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_registerMouseExited
// TODO 将在此处添加您的处理代码:
setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
}//GEN-LAST:event_registerMouseExited
private void registerMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_registerMouseMoved
// TODO 将在此处添加您的处理代码:
setCursor(new Cursor(Cursor.HAND_CURSOR));
}//GEN-LAST:event_registerMouseMoved
private void cancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelActionPerformed
// TODO 将在此处添加您的处理代码:
dispose();
}//GEN-LAST:event_cancelActionPerformed
// 变量声明 - 不进行修改//GEN-BEGIN:variables
private javax.swing.JLabel UserID;
private javax.swing.JLabel Welecome;
private javax.swing.JButton cancel;
private javax.swing.JLabel change;
private javax.swing.JButton login;
private javax.swing.JLabel password;
private javax.swing.JPasswordField passwordText;
private javax.swing.JLabel register;
private javax.swing.JTextField userIDText;
// 变量声明结束//GEN-END:variables
ValidateUser vu;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -