@Override public void keyReleased(KeyEvent e){
  char[] password1=null;
  char[] password2=null;
  if (newPasswordField != null) {
    password1=newPasswordField.getPassword();
  }
  if (repeatNewPasswordField != null) {
    password2=repeatNewPasswordField.getPassword();
  }
  boolean tickLabelVisible=false;
  if (password1 != null && password2 != null) {
    if (Arrays.equals(password1,password2)) {
      tickLabelVisible=true;
    }
  }
  tickLabel.setVisible(tickLabelVisible);
  clearMessages();
  for (int i=0; i < password1.length; i++) {
    password1[i]=0;
  }
  for (int i=0; i < password2.length; i++) {
    password2[i]=0;
  }
}

@ Override public void keyReleased ( KeyEvent e ) { char [ ] password1 = null ; char [ ] password2 = null ; if ( newPasswordField != null ) { password1 = newPasswordField . getPassword ( ) ; } if ( repeatNewPasswordField != null ) { password2 = repeatNewPasswordField . getPassword ( ) ; } boolean tickLabelVisible = false ; if ( password1 != null && password2 != null ) { if ( Arrays . equals ( password1 , password2 ) ) { tickLabelVisible = true ; } } tickLabel . setVisible ( tickLabelVisible ) ; clearMessages ( ) ; for ( int i = 0 ; i < password1 . length ; i ++ ) { password1 [ i ] = 0 ; } for ( int i = 0 ; i < password2 . length ; i ++ ) { password2 [ i ] = 0 ; } }
handle the key - released event from the text field .
