📄 reworkpasswordframe.java
字号:
/*
* ReworkPasswordFrame.java
*
* Created on 2007年5月25日, 下午10:53
*/
package form;
import javax.swing.JOptionPane;
import table.Users;
import task.HandleUsers;
import util.ConstentUtil;
/**
*
* @author 下雪天
*/
public class ReworkPasswordFrame extends javax.swing.JInternalFrame {
/** Creates new form ReworkPasswordFrame */
public ReworkPasswordFrame() {
initComponents();
//String user=(String)ConstentUtil.hashtable.get(ConstentUtil.user);
lbluser.setText(ConstentUtil.user);
}
/** 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() {
jLabel1 = new javax.swing.JLabel();
lbluser = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jLabel5 = new javax.swing.JLabel();
txtop = new javax.swing.JPasswordField();
txtnp = new javax.swing.JPasswordField();
txtpp = new javax.swing.JPasswordField();
jLabel1.setText("\u7528\u6237\u767b\u5f55\u540d\uff1a");
jLabel3.setText("\u8f93\u5165\u65e7\u5bc6\u7801\uff1a");
jLabel4.setText("\u8f93\u5165\u65b0\u5bc6\u7801\uff1a");
jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/save.gif")));
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/exit.gif")));
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
jLabel5.setText("\u786e\u8ba4\u65b0\u5bc6\u7801\uff1a");
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(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
.add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
.addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jLabel3)
.add(jLabel1)
.add(jLabel4))
.add(31, 31, 31))
.add(layout.createSequentialGroup()
.add(106, 106, 106)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
.add(jLabel5)
.add(jButton1))
.add(34, 34, 34)))
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
.add(jButton2)
.add(lbluser, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(txtpp, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 122, Short.MAX_VALUE)
.add(txtnp)
.add(txtop))
.addContainerGap(97, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(18, 18, 18)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel1)
.add(lbluser, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 15, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.add(16, 16, 16)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel3)
.add(txtop, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.add(15, 15, 15)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel4)
.add(txtnp, 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(jLabel5)
.add(txtpp, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.add(32, 32, 32)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jButton2)
.add(jButton1))
.addContainerGap(58, Short.MAX_VALUE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
// TODO 将在此处添加您的处理代码:
String str1=txtnp.getText().trim();
String str2=txtpp.getText().trim();
if(str1!=str2){
HandleUsers hu=new HandleUsers();
Users u=new Users();
u.setUserName(ConstentUtil.user);
u.setPasswordCode(txtnp.getText());
hu.updatep(u);
JOptionPane.showMessageDialog(this,"修改成功!","",JOptionPane.WARNING_MESSAGE);
}
else
{
txtop.setText("");
txtnp.setText("");
txtpp.setText("");
JOptionPane.showMessageDialog(this,"输入有误,请重新修改!","",JOptionPane.WARNING_MESSAGE);
}
}//GEN-LAST:event_jButton1ActionPerformed
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
// TODO 将在此处添加您的处理代码:
this.dispose();
ConstentUtil.hashtable.remove("ReworkPasswordFrame");
}//GEN-LAST:event_jButton2ActionPerformed
// 变量声明 - 不进行修改//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel lbluser;
private javax.swing.JPasswordField txtnp;
private javax.swing.JPasswordField txtop;
private javax.swing.JPasswordField txtpp;
// 变量声明结束//GEN-END:variables
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -