Examples of JPasswordField


Examples of javax.swing.JPasswordField


  protected void dialogInit(){
   
//    setUndecorated(true);
    passwordOldField = new JPasswordField(20);
    password1Field = new JPasswordField(20);
    password2Field = new JPasswordField(20);
    passwordOldLabel = new JLabel("Enter old password:");
    password1Label = new JLabel("Enter password:");
    password2Label = new JLabel("Enter password again:");
    okButton = new JButton("Ok");
    cancelButton = new JButton("Cancel");
View Full Code Here

Examples of javax.swing.JPasswordField

    getMiddleLogInPanel().add(lblPassword);
    lblPassword.setAlignmentX(Component.CENTER_ALIGNMENT);
    lblPassword.setForeground(textColor);
    lblPassword.setFont(new Font("Segoe UI", Font.PLAIN, 11));

    passwordField = new JPasswordField();
    getMiddleLogInPanel().add(passwordField);
    passwordField.setEchoChar('*');
    passwordField.setColumns(8);

    JLabel empty_3 = new JLabel("          ");
View Full Code Here

Examples of javax.swing.JPasswordField

    this.username = username;
  }

  @Override
  public boolean promptPassphrase(String message) {
    final JPasswordField field = new JPasswordField(20);
    final int result = JOptionPane.showConfirmDialog(null, new Object[] { new JLabel(message), field }, TITLE, JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, clayIcon);
    if (result == JOptionPane.OK_OPTION) {
      passphrase = new String(field.getPassword());
      return true;
    }
    return false;
  }
View Full Code Here

Examples of javax.swing.JPasswordField

    return false;
  }

  @Override
  public boolean promptPassword(String message) {
    final JPasswordField field = new JPasswordField(20);
    final int result = JOptionPane.showConfirmDialog(null, new Object[] { new JLabel(message), field }, TITLE, JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, clayIcon);
    if (result == JOptionPane.OK_OPTION) {
      password = new String(field.getPassword());
      return true;
    }
    return false;   
  }
View Full Code Here

Examples of javax.swing.JPasswordField

    JPanel connectionPanel;

    JLabel userNameLabel = new JLabel(username + ":   ", JLabel.RIGHT);
    JTextField userNameField = new JTextField("");
    JLabel passwordLabel = new JLabel(password + ":   ", JLabel.RIGHT);
    JTextField passwordField = new JPasswordField("");
    connectionPanel = new JPanel(false);
    connectionPanel.setLayout(new BoxLayout(connectionPanel, BoxLayout.X_AXIS));
    JPanel namePanel = new JPanel(false);
    namePanel.setLayout(new GridLayout(0, 1));
    namePanel.add(userNameLabel);
    namePanel.add(passwordLabel);
    JPanel fieldPanel = new JPanel(false);
    fieldPanel.setLayout(new GridLayout(0, 1));
    fieldPanel.add(userNameField);
    fieldPanel.add(passwordField);
    connectionPanel.add(namePanel);
    connectionPanel.add(fieldPanel);

    if (JOptionPane.showOptionDialog(null, connectionPanel, "Clay - " + title, JOptionPane.OK_CANCEL_OPTION,
        JOptionPane.INFORMATION_MESSAGE, null, new String[] { "Ok", "Cancel" }, "hej") != 0) {
      return null;
    }
    return new String[] { userNameField.getText(), passwordField.getText() };
  }
View Full Code Here

Examples of javax.swing.JPasswordField

//    for(BOUser user : users) {
//      //System.out.println(user.toString() + "[" + user.getContact().getFirstName() + "]");
//      userList.addItem(user);
//    }
    txtUserName = new JTextField(ApplicationContext.getUserPreferences().getLastLoggedInUserID(), 15);
    txtPass = new JPasswordField("", 15);

    btnOK = new JButton(UILabelResourceManager.getInstance().getString(TEXT_BUTTON_LOGIN));
    btnOK.setIcon(IconHelper.getLoginIcon());
    btnClose = new JButton(UILabelResourceManager.getInstance().getString(TEXT_BUTTON_CLOSE));
    btnClose.setIcon(IconHelper.getCloseIcon());
View Full Code Here

Examples of javax.swing.JPasswordField

  public void showDialog() {
   
    JDialog dialog = new JDialog(this, true);
    dialog.setTitle("Password");
    JLabel passwordLabel = new JLabel("Enter your password:");
    JPasswordField passwordField = new JPasswordField(15);
    Container content = dialog.getContentPane();
    content.setLayout(new BorderLayout());
    JPanel panel1 = new JPanel();
    panel1.setLayout(new BoxLayout(panel1, BoxLayout.X_AXIS));
    panel1.add(passwordLabel);
View Full Code Here

Examples of javax.swing.JPasswordField

    return JOptionPane.showInputDialog(null,message);
  }

  private static String askPassword2() {
    JPasswordField pf = new JPasswordField();
    Object[] message = new Object[] { "Enter password:", pf };
    Object[] options = new String[] { "Ok", "Cancel" };

    if (JOptionPane
      .showOptionDialog(
        null,
        message,
        "Password",
        JOptionPane.OK_CANCEL_OPTION,
        JOptionPane.QUESTION_MESSAGE,
        null,
        null,
        null)
      == 0) { // OK
      return String.valueOf(pf.getPassword());
    } else {
      return null; // Cancel
    }
  }
View Full Code Here

Examples of javax.swing.JPasswordField

  protected void dialogInit(){
   
//    setUndecorated(true);
    passwordLabel = new JLabel("Enter password:");
    passwordField = new JPasswordField(20);
    okButton = new JButton("Ok");
    cancelButton = new JButton("Cancel");

    super.dialogInit();
View Full Code Here

Examples of javax.swing.JPasswordField

    this.userNameLabel = new JLabel("用户名:", JLabel.CENTER);
    this.userNameField = new JTextField("admin");
    this.userNameField.setActionCommand(LogonAdapter.USERNAME_COMMAND);
   
    this.passwordLabel = new JLabel("密  码:", JLabel.CENTER);
    this.passwordField = new JPasswordField("admin");
    this.passwordField.setActionCommand(LogonAdapter.PASSWORD_COMMAND);
   
    this.submitBtn = new JButton("登录");
    this.submitBtn.setActionCommand(LogonAdapter.LOGON_COMMAND);
    this.submitBtn.addActionListener(logonActionListener);
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.