Tabnine Logo
JPasswordField.requestFocusInWindow
Code IndexAdd Tabnine to your IDE (free)

How to use
requestFocusInWindow
method
in
javax.swing.JPasswordField

Best Java code snippets using javax.swing.JPasswordField.requestFocusInWindow (Showing top 20 results out of 315)

origin: stackoverflow.com

if (!gainedFocusBefore) {
 gainedFocusBefore = true;
 passwordField.requestFocusInWindow();
origin: com.itextpdf/itext-rups

  @Override
  public void selectInitialValue() {
    passwordField.requestFocusInWindow();
  }
};
origin: es.gob.afirma/afirma-ui-core-jse

  /** {@inheritDoc} */
  @Override
  public void selectInitialValue() {
    pwd.requestFocusInWindow();
  }
};
origin: org.netbeans.modules/org-netbeans-modules-dlight-nativeexecution-nb

  @Override
  public void windowGainedFocus(WindowEvent e) {
    suPasswordField.requestFocusInWindow();
  }
});
origin: Multibit-Legacy/multibit-hd

@Override
public void requestInitialFocus() {
 password1.requestFocusInWindow();
}
origin: Multibit-Legacy/multibit-hd

@Override
public void requestInitialFocus() {
 password.requestFocusInWindow();
}
origin: omegat-org/omegat

  @Override
  public void windowOpened(WindowEvent e) {
    // Pack again to ensure the height is correct for the now-wrapped message area
    dialog.pack();
    panel.passwordField.requestFocusInWindow();
  }
});
origin: omegat-org/omegat

  @Override
  public void windowOpened(WindowEvent e) {
    // Pack again to ensure the height is correct for the now-wrapped message area
    dialog.pack();
    panel.passwordField.requestFocusInWindow();
  }
});
origin: org.netbeans.modules/org-netbeans-modules-php-project

@Override
public void addNotify() {
  super.addNotify();
  passwordField.requestFocusInWindow();
}
origin: net.imagej/imagej-ui-swing

private void setChangePasswordEnabled(final boolean enabled) {
  passwordLabel.setEnabled(enabled);
  passwordField.setEnabled(enabled);
  if (enabled) passwordField.requestFocusInWindow();
}
origin: net.sf.squirrel-sql.plugins/firebirdmanager

public void setFocusToFirstEmptyInputField() {
  if (jtextfieldUsername.getText().length() == 0) {
    jtextfieldUsername.requestFocusInWindow();
  } else {
    jpasswordfieldPW.requestFocusInWindow();
  }
}
origin: stackoverflow.com

final JPasswordField pf = new JPasswordField(10);
 JOptionPane op = new JOptionPane(pf, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION);
 JDialog d = op.createDialog("Test");
 d.addWindowFocusListener(new WindowAdapter() {
   @Override
   public void windowGainedFocus(WindowEvent e) {
     pf.requestFocusInWindow();
   }
 });
 d.pack();
 d.setLocationRelativeTo(null);
 d.setVisible(true);
origin: edu.uiuc.ncsa.myproxy/myproxy-logon

/**
 * Create the GUI and show it. For thread safety, this method should be
 * invoked from the event dispatch thread.
 */
public static void createAndShowGUI() {
  JFrame frame = new JFrame("MyProxyLogon " + version);
  MyProxyLogonGUI gui = new MyProxyLogonGUI();
  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  frame.add(gui);
  frame.pack();
  gui.passwordField.requestFocusInWindow();
  frame.setVisible(true);
}
origin: stackoverflow.com

final JPasswordField pf = new JPasswordField();
 //Create OptionPane & Dialog
 JOptionPane pane = new JOptionPane(pf, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION);
 JDialog dialog = pane.createDialog("ENTER SUPERUSER PASSWORD");
 //Add a listener to the dialog to request focus of Password Field
 dialog.addComponentListener(new ComponentListener(){
   @Override
   public void componentShown(ComponentEvent e) {
     pf.requestFocusInWindow();
   }
   @Override public void componentHidden(ComponentEvent e) {}
   @Override public void componentResized(ComponentEvent e) {}
   @Override public void componentMoved(ComponentEvent e) {}
   });
 dialog.setVisible(true);
origin: stackoverflow.com

 public static String getPassword(String title) {
    JPanel panel = new JPanel();
    final JPasswordField passwordField = new JPasswordField(10);
    panel.add(new JLabel("Password"));
    panel.add(passwordField);
    JOptionPane pane = new JOptionPane(panel, JOptionPane.QUESTION_MESSAGE, JOptionPane.OK_CANCEL_OPTION) {
      @Override
      public void selectInitialValue() {
        passwordField.requestFocusInWindow();
      }
    };
    pane.createDialog(null, title).setVisible(true);
    return passwordField.getPassword().length == 0 ? null : new String(passwordField.getPassword());
}
origin: net.sf.squirrel-sql.plugins/firebirdmanager

public void setFocusToFirstEmptyInputField() {
  if (jtextfieldServer.getText().length() == 0) {
    jtextfieldServer.requestFocusInWindow();
  } else if (jtextfieldPort.getText().length() == 0) {
    jtextfieldPort.requestFocusInWindow();
  } else if (jtextfieldManagerUsername.getText().length() == 0) {
    jtextfieldManagerUsername.requestFocusInWindow();
  } else {
    jpasswordfieldManager.requestFocusInWindow();
  }
}

origin: martin-lizner/trezor-ssh-agent

private void addInputArea() {
  labelPanel.setLayout(new GridLayout(3, 1));
  Border labelsPadding = BorderFactory.createEmptyBorder(0, 0, 15, 0);
  labelPanel.setBorder(labelsPadding);
  deviceLabel = new JLabel(AgentConstants.APP_PUBLIC_NAME.toUpperCase());
  Icon icon = new ImageIcon(TrayProcess.createImage(AgentConstants.ICON24_PATH, AgentConstants.ICON_DESCRIPTION));
  deviceLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0));
  deviceLabel.setIcon(icon);
  deviceLabel.setIconTextGap(10);
  deviceLabel.setFont(new Font(null, Font.BOLD, 15));
  passcodeLabel = new JLabel(LocalizedLogger.getLocalizedMessage("DIALOG_ENTER_PASSPHRASE"));
  passcodeField = new JPasswordField();
  passcodeField.requestFocusInWindow();
  passcodeField.setBackground(Color.white);
  labelPanel.add(deviceLabel, BorderLayout.NORTH);
  labelPanel.add(passcodeLabel, BorderLayout.CENTER);
  labelPanel.add(passcodeField, BorderLayout.SOUTH);
}
origin: stackoverflow.com

 final JPasswordField jpf = new JPasswordField();
JOptionPane jop = new JOptionPane(jpf, JOptionPane.QUESTION_MESSAGE,
    JOptionPane.OK_CANCEL_OPTION);
JDialog dialog = jop.createDialog("Password:");
dialog.addComponentListener(new ComponentAdapter() {
  @Override
  public void componentShown(ComponentEvent e) {
    SwingUtilities.invokeLater(new Runnable() {
      @Override
      public void run() {
        jpf.requestFocusInWindow();
      }
    });
  }
});
dialog.setVisible(true);
int result = (Integer) jop.getValue();
dialog.dispose();
char[] password = null;
if (result == JOptionPane.OK_OPTION) {
  password = jpf.getPassword();
}
if (password != null)
  System.out.println("your password: " + new String(password));
origin: stackoverflow.com

 final JPasswordField jpf = new JPasswordField();

JOptionPane jop = new JOptionPane(jpf, JOptionPane.QUESTION_MESSAGE,
    JOptionPane.OK_CANCEL_OPTION);

JDialog dialog = jop.createDialog("Password:");
dialog.addComponentListener(new ComponentAdapter() {
  @Override
  public void componentShown(ComponentEvent e) {
    SwingUtilities.invokeLater(new Runnable() {
      @Override
      public void run() {
        jpf.requestFocusInWindow();
      }
    });
  }
});
dialog.setVisible(true);
int result = (Integer) jop.getValue();
dialog.dispose();
char[] password = null;
if (result == JOptionPane.OK_OPTION) {
  password = jpf.getPassword();
}
if (password != null)
  System.out.println("your password: " + new String(password));
origin: omegat-org/omegat

private String askPassphrase(String prompt) {
  GITUserPassDialog userPassDialog = new GITUserPassDialog(Core.getMainWindow().getApplicationFrame());
  userPassDialog.setLocationRelativeTo(Core.getMainWindow().getApplicationFrame());
  userPassDialog.descriptionTextArea.setText(prompt);
  userPassDialog.userText.setVisible(false);
  userPassDialog.userLabel.setVisible(false);
  userPassDialog.passwordField.requestFocusInWindow();
  userPassDialog.setVisible(true);
  if (userPassDialog.getReturnStatus() == GITUserPassDialog.RET_OK) {
    return new String(userPassDialog.passwordField.getPassword());
  } else {
    return null;
  }
}
javax.swingJPasswordFieldrequestFocusInWindow

Popular methods of JPasswordField

  • <init>
  • getPassword
  • setText
  • setEnabled
  • addActionListener
  • addKeyListener
  • setColumns
  • getDocument
  • setEchoChar
  • setEditable
  • setPreferredSize
  • addFocusListener
  • setPreferredSize,
  • addFocusListener,
  • setFont,
  • setToolTipText,
  • setName,
  • getEchoChar,
  • getText,
  • requestFocus,
  • setDocument

Popular in Java

  • Start an intent from android
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • findViewById (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • Menu (java.awt)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now