/** * Set the editable status of the password box. * * @param editable true if the password box is editable */ public void setEditable(boolean editable) { m_password.setEditable(editable); } }
/** * Set the editable status of the password box. * * @param editable true if the password box is editable */ public void setEditable(boolean editable) { m_password.setEditable(editable); } }
public void setEditable(boolean b) { comp.setEditable(b); }
/** * Builds a new {@code PasswordType}. * @param columns * The number of columns for the underlying component. * @param isEditable * To specify if the component can be edited or not. */ public PasswordType(int columns, boolean isEditable) { comp.setColumns(columns); comp.setEditable(isEditable); }
@Override public void setEditable(boolean editable) { getSwingComponent().setEditable(editable); }
private void addLabelArea() { 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_PIN")); passcodeField = new JPasswordField(3); passcodeField.setEditable(false); passcodeField.setBackground(Color.white); labelPanel.add(deviceLabel, BorderLayout.NORTH); labelPanel.add(passcodeLabel, BorderLayout.CENTER); labelPanel.add(passcodeField, BorderLayout.SOUTH); }
/** * Enables/Disables the editable components in the login screen. * * @param editable true to enable components, otherwise false to disable. */ private void enableComponents(boolean editable) { // Need to set both editable and enabled for best behavior. usernameField.setEditable(editable); usernameField.setEnabled(editable && !loginAnonymouslyBox.isSelected()); passwordField.setEditable(editable); passwordField.setEnabled(editable && !loginAnonymouslyBox.isSelected()); final String lockedDownURL = Default.getString(Default.HOST_NAME); if (!ModelUtil.hasLength(lockedDownURL)) { serverField.setEditable(editable); serverField.setEnabled(editable); } if (editable) { // Reapply focus to username field passwordField.requestFocus(); } }
passwordField.setEditable(false);
public void actionPerformed(ActionEvent ae) { char[] passKPFromUser = keystorePassword.getPassword(); if (sslUtils.verifyMasterPassword(passKPFromUser)) { okForKP.setEnabled (false); cancelForKP.setEnabled (false); keystorePassword.setEditable (false); CardLayout cl = (CardLayout) (getContentPane ()).getLayout (); cl.show (getContentPane (), pnlCertificateList); } else { String errmessage = localStrings.getLocalString("enterprise.security.IncorrectKeystorePassword","Incorrect Keystore Password"); GUIErrorDialog guierr = new GUIErrorDialog(errmessage); guierr.setVisible(true); } Arrays.fill(passKPFromUser, ' '); } });
public void actionPerformed(ActionEvent ae) { char[] passKPFromUser = keystorePassword.getPassword(); if (sslUtils.verifyMasterPassword(passKPFromUser)) { okForKP.setEnabled (false); cancelForKP.setEnabled (false); keystorePassword.setEditable (false); CardLayout cl = (CardLayout) (getContentPane ()).getLayout (); cl.show (getContentPane (), pnlCertificateList); } else { String errmessage = localStrings.getLocalString("enterprise.security.IncorrectKeystorePassword","Incorrect Keystore Password"); GUIErrorDialog guierr = new GUIErrorDialog(errmessage); guierr.setVisible(true); } Arrays.fill(passKPFromUser, ' '); } });
public JComponent create() { JPasswordField password = new JPasswordField(); if (hasAttribute("size")) { int size = GeneralUtil.parseIntRelaxed(getAttribute("size")); // Size of 0 doesn't make any sense, so use default value if (size == 0) { password.setColumns(15); } else { password.setColumns(size); } } else { password.setColumns(15); } if (hasAttribute("maxlength")) { password.setDocument( new SizeLimitedDocument( GeneralUtil.parseIntRelaxed(getAttribute("maxlength")))); } if (hasAttribute("readonly") && getAttribute("readonly").equals("readonly")) { password.setEditable(false); } return password; }
public JComponent create() { JPasswordField password = new JPasswordField(); if (hasAttribute("size")) { int size = GeneralUtil.parseIntRelaxed(getAttribute("size")); // Size of 0 doesn't make any sense, so use default value if (size == 0) { password.setColumns(15); } else { password.setColumns(size); } } else { password.setColumns(15); } if (hasAttribute("maxlength")) { password.setDocument( new SizeLimitedDocument( GeneralUtil.parseIntRelaxed(getAttribute("maxlength")))); } if (hasAttribute("readonly") && getAttribute("readonly").equalsIgnoreCase("readonly")) { password.setEditable(false); } return password; }
@Override JPasswordField initSwingComponent() { TextField textField = getAWTComponent(); JPasswordField swingComponent = new JPasswordField(); swingComponent.setText(textField.getText()); swingComponent.setColumns(textField.getColumns()); swingComponent.setEchoChar(textField.getEchoChar()); swingComponent.setEditable(textField.isEditable()); swingComponent.select(textField.getSelectionStart(), textField.getSelectionEnd()); swingComponent.addActionListener(new SwingTextFieldListener()); return swingComponent; }
public JComponent create() { JPasswordField password = new JPasswordField(); if (hasAttribute("size")) { int size = GeneralUtil.parseIntRelaxed(getAttribute("size")); // Size of 0 doesn't make any sense, so use default value if (size == 0) { password.setColumns(15); } else { password.setColumns(size); } } else { password.setColumns(15); } if (hasAttribute("maxlength")) { password.setDocument( new SizeLimitedDocument( GeneralUtil.parseIntRelaxed(getAttribute("maxlength")))); } if (hasAttribute("readonly") && getAttribute("readonly").equalsIgnoreCase("readonly")) { password.setEditable(false); } return password; }
public JComponent create() { JPasswordField password = new JPasswordField(); if (hasAttribute("size")) { int size = GeneralUtil.parseIntRelaxed(getAttribute("size")); // Size of 0 doesn't make any sense, so use default value if (size == 0) { password.setColumns(15); } else { password.setColumns(size); } } else { password.setColumns(15); } if (hasAttribute("maxlength")) { password.setDocument( new SizeLimitedDocument( GeneralUtil.parseIntRelaxed(getAttribute("maxlength")))); } if (hasAttribute("readonly") && getAttribute("readonly").equalsIgnoreCase("readonly")) { password.setEditable(false); } return password; }
gbc.insets.top = 5; pinField = new JPasswordField(); pinField.setEditable(false); frame.add(pinField, gbc);