public void actionOk() { boolean passwordSet = false; String passwordOld = new String(jpfPasswordOld.getPassword()); String passwordNew = new String(jpfPasswordNew.getPassword()); String passwordConfirm = new String(jpfPasswordConfirm.getPassword()); if (passwordOld.length() == 0) { miClient.showMsgBoxWarning( DGuiConsts.ERR_MSG_FIELD_REQ + "'" + DGuiUtils.getLabelName(jlPasswordOld.getText()) + "'."); jpfPasswordOld.requestFocus(); } else if (passwordNew.length() == 0) { miClient.showMsgBoxWarning( DGuiConsts.ERR_MSG_FIELD_REQ + "'" + DGuiUtils.getLabelName(jlPasswordNew.getText()) + "'."); jpfPasswordNew.requestFocus(); } else if (passwordConfirm.length() == 0) { miClient.showMsgBoxWarning( DGuiConsts.ERR_MSG_FIELD_REQ + "'" + DGuiUtils.getLabelName(jlPasswordConfirm.getText()) + "'."); jpfPasswordConfirm.requestFocus(); } else if (passwordNew.compareTo(passwordConfirm) != 0) { miClient.showMsgBoxWarning( DGuiConsts.ERR_MSG_FIELD_REQ_EQUAL + "'" + DGuiUtils.getLabelName(jlPasswordNew.getText()) + "', '" + DGuiUtils.getLabelName(jlPasswordConfirm.getText()) + "'."); jpfPasswordOld.requestFocus(); resetPasswords(); } else { try { passwordSet = DUtilUtils.processNewPassword(miClient, passwordOld, passwordNew); } catch (SQLException e) { DLibUtils.showException(this, e); } catch (Exception e) { DLibUtils.showException(this, e); } finally { if (!passwordSet) { resetPasswords(); jpfPasswordOld.requestFocus(); } } } if (passwordSet) { mnFormResult = DGuiConsts.FORM_RESULT_OK; dispose(); } }
private void windowActivated() { if (mbFirstActivation) { mbFirstActivation = false; jtfUser.setText(miClient.getSession().getUser().getName()); jpfPasswordOld.requestFocus(); } }
/** Creates new form DUtilLoginDlg */ public DUtilPasswordDlg(DGuiClient client) { super(client.getFrame(), true); miClient = client; initComponents(); initComponentsCustom(); }