Action () { return new DialogWrapper.OkAction() { @Override protected void doAction(ActionEvent e) { myCredentials = new Credentials(myLoginField.getText(), String.valueOf(myPasswordField.getPassword())); super.doAction(e); } }; }