📄 registerframe.java
字号:
package com.cn.szhaccp.landing;
/*
* RegisterFrame.java
*
* Created on 2007年4月28日, 上午11:41
*/
/**
*
* @author Admin
*/
public class RegisterFrame extends javax.swing.JDialog {
/** Creates new form RegisterFrame */
public RegisterFrame(java.awt.Frame parent, boolean modal) {
super(parent, modal);
this.setResizable(false);
ToCenter tc = new ToCenter();
au = new AddUser();
initComponents();
tc.SetDialogToCenter(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() {
username = new javax.swing.JLabel();
name = new javax.swing.JLabel();
password1 = new javax.swing.JLabel();
password2 = new javax.swing.JLabel();
usernameText = new javax.swing.JTextField();
nameText = new javax.swing.JTextField();
passwordText1 = new javax.swing.JPasswordField();
passwordText2 = new javax.swing.JPasswordField();
enter = new javax.swing.JButton();
cancel = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setTitle("\u6ce8\u518c");
username.setText("\u7528 \u6237 \u540d:");
name.setText("\u6635 \u79f0:");
password1.setText("\u5bc6 \u7801:");
password2.setText("\u786e\u8ba4\u5bc6\u7801:");
enter.setText("\u6ce8 \u518c");
enter.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
enterActionPerformed(evt);
}
});
cancel.setText("\u53d6 \u6d88");
cancel.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cancelActionPerformed(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(layout.createSequentialGroup()
.add(49, 49, 49)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(password2)
.addContainerGap())
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(password1)
.addContainerGap())
.add(layout.createSequentialGroup()
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(username)
.add(name))
.add(14, 14, 14)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
.add(nameText, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 151, Short.MAX_VALUE)
.add(usernameText, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 151, Short.MAX_VALUE)
.add(org.jdesktop.layout.GroupLayout.LEADING, passwordText1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 151, Short.MAX_VALUE)
.add(passwordText2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 151, Short.MAX_VALUE))
.add(58, 58, 58)))))
.add(layout.createSequentialGroup()
.add(65, 65, 65)
.add(enter)
.add(47, 47, 47)
.add(cancel)
.addContainerGap(88, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(34, 34, 34)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(username)
.add(usernameText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.add(14, 14, 14)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(name)
.add(nameText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.add(14, 14, 14)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(password1)
.add(passwordText1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.add(21, 21, 21)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(password2)
.add(passwordText2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.add(27, 27, 27)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(enter)
.add(cancel))
.addContainerGap(20, Short.MAX_VALUE))
);
layout.linkSize(new java.awt.Component[] {nameText, passwordText1, passwordText2, usernameText}, org.jdesktop.layout.GroupLayout.VERTICAL);
pack();
}// </editor-fold>//GEN-END:initComponents
private void enterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_enterActionPerformed
// TODO 将在此处添加您的处理代码:
au.addUser(RegisterFrame.this,usernameText.getText(),nameText.getText(),String.valueOf(passwordText1.getPassword()),String.valueOf(passwordText2.getPassword()));
usernameText.setText("");
nameText.setText("");
passwordText1.setText("");
passwordText2.setText("");
}//GEN-LAST:event_enterActionPerformed
private void cancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelActionPerformed
// TODO 将在此处添加您的处理代码:
dispose();
}//GEN-LAST:event_cancelActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new RegisterFrame(new javax.swing.JFrame(), true).setVisible(true);
}
});
}
// 变量声明 - 不进行修改//GEN-BEGIN:variables
private javax.swing.JButton cancel;
private javax.swing.JButton enter;
private javax.swing.JLabel name;
private javax.swing.JTextField nameText;
private javax.swing.JLabel password1;
private javax.swing.JLabel password2;
private javax.swing.JPasswordField passwordText1;
private javax.swing.JPasswordField passwordText2;
private javax.swing.JLabel username;
private javax.swing.JTextField usernameText;
// 变量声明结束//GEN-END:variables
AddUser au;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -