Package javax.swing

Examples of javax.swing.JPasswordField.addFocusListener()


            // ask the user for the relevant information to locate the
            // schedule.
            JTextField url = new JTextField(urlStr, 40);
            url.addFocusListener(new FocusHighlighter(url));
            JTextField password = new JPasswordField(passwordStr, 10);
            password.addFocusListener(new FocusHighlighter(password));
            String urlLabel = resources.getString("Import_Schedule.URL_Label");
            String passwordLabel =
                resources.getString("Import_Schedule.Password_Label");
            Object message = new Object[] {
                errorMessage,
View Full Code Here


        // a subtle bug where if you enter a value in a line, do not
        // hit return, and then click on the X to close the window,
        // the value is restored to the original, and then sometime
        // later, the focus is lost and the entered value becomes
        // the value of the parameter.  I don't know of any workaround.
        entryBox.addFocusListener(new QueryFocusListener(name));
    }

    /** Add a listener.  The changed() method of the listener will be
     *  called when any of the entries is changed.  Note that "line"
     *  entries only trigger this call when Return or Enter is pressed, or
View Full Code Here

    txtPass1.setFont(new Font("Lucida Fax", Font.PLAIN, 13));
    txtPass1.setBackground(Color.decode("#3b5998"));
    txtPass1.setForeground(Color.WHITE);
    this.add(txtPass1, "cell 0 4,growx");
    txtPass1.setColumns(10);
    txtPass1.addFocusListener(new FocusListener() {

          public void focusGained(FocusEvent e) {
              txtPass1.setEchoChar('*');
              if (txtPass1.getText().equals("Enter Password")) {
                txtPass1.setText("");
View Full Code Here

      @Override
      public void actionPerformed(ActionEvent arg0) {
        container.replace(new LoginPanel(container));
      } });
    txtPass2.addFocusListener(new FocusListener() {

          public void focusGained(FocusEvent e) {
              txtPass2.setEchoChar('*');
              if (txtPass2.getText().equals("Re-enter Password")) {
                txtPass2.setText("");
View Full Code Here

    txtPassword.setFont(new Font("Lucida Fax", Font.PLAIN, 13));
    txtPassword.setBackground(Color.decode("#3b5998"));
    txtPassword.setForeground(Color.WHITE);
    this.add(txtPassword, "cell 0 3,growx");
    txtPassword.setColumns(10);
    txtPassword.addFocusListener(new FocusListener() {

          public void focusGained(FocusEvent e) {
              txtPassword.setEchoChar('*');
              if (txtPassword.getText().equals("Password")) {
                txtPassword.setText("");
View Full Code Here

        if (dl != null) {
            tf.getDocument().addDocumentListener(dl);
        }
       
        if (fa != null) {
            tf.addFocusListener(fa);
        }
       
        return tf;
    }
   
View Full Code Here

        if (dl != null) {
            tf.getDocument().addDocumentListener(dl);
        }
       
        if (fa != null) {
            tf.addFocusListener(fa);
        }
       
        return tf;
    }
   
View Full Code Here

   * @return the created password text field.
   */
  public static JPasswordField createPasswordField()
  {
    JPasswordField pf = new JPasswordField();
    pf.addFocusListener(new TextComponentFocusListener(pf));
    pf.setFont(ColorAndFontConstants.defaultFont);
    return pf;
  }

  /**
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.