Codota Logo
JPasswordField.requestFocusInWindow
Code IndexAdd Codota 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)

  • Common ways to obtain JPasswordField
private void myMethod () {
JPasswordField j =
  • Codota Iconnew JPasswordField()
  • Codota Iconnew JPasswordField(int1)
  • Codota IconString str;new JPasswordField(str)
  • Smart code suggestions by Codota
}
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() {
 password.requestFocusInWindow();
}
origin: Multibit-Legacy/multibit-hd

@Override
public void requestInitialFocus() {
 password1.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

  • Running tasks concurrently on multiple threads
  • setScale (BigDecimal)
  • getExternalFilesDir (Context)
  • addToBackStack (FragmentTransaction)
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • HashSet (java.util)
    This class implements the Set interface, backed by a hash table (actually a HashMap instance). It m
  • List (java.util)
    A List is a collection which maintains an ordering for its elements. Every element in the List has a
  • JComboBox (javax.swing)
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now