Package javax.swing

Examples of javax.swing.JPasswordField


    mainTable.setIntercellSpacing(new Dimension(3, 3));
    mainTable.setDefaultRenderer(String.class, new JPdfSelectionTableRenderer());

    TableColumnModel mainTableColModel = mainTable.getColumnModel();
    mainTableColModel.getColumn(AbstractPdfSelectionTableModel.PASSWORD).setCellEditor(
        new DefaultCellEditor(new JPasswordField()));

    TableColumn tc = mainTableColModel.getColumn(AbstractPdfSelectionTableModel.ROW_NUM);
    tc.setPreferredWidth(25);
    tc.setMaxWidth(35);
View Full Code Here


  /**
   * Shows a dialog for selecting a password.
   */
  public static char[] showPassphraseDialog(String alias) {
    JPasswordField field = new JPasswordField();
    //int value = JOptionPane.showConfirmDialog(Pooka.getMainPanel(), field, "Enter passphrase", JOptionPane.YES_NO_OPTION);
    JLabel label = new JLabel(Pooka.getProperty("Pooka.crypto.passphrase.message", "Enter passphrase for key ") + alias);
    Object[] messageComponents = new Object[] { label, field };
    field.setRequestFocusEnabled(true);

    int value = Pooka.getUIFactory().showConfirmDialog(messageComponents, Pooka.getProperty("Pooka.crypto.passphrase.title", "Enter passphrase"), JOptionPane.OK_CANCEL_OPTION);

    if (value != JOptionPane.CANCEL_OPTION) {
      return field.getPassword();
    }
   
    return null;

    /*
 
View Full Code Here

   * @param comp
   * @return an integer indicating the option chosen by the user
   */
  public static String askForDocumentPasswordDialog(Component comp, String filename) {
    String retVal = null;
    JPasswordField passwordField = new JPasswordField();
    Object[] message = new Object[] {
        GettextResource.gettext(Configuration.getInstance().getI18nResourceBundle(),
            "Please provide the password to open the encrypted document"), filename, passwordField };
    passwordField.requestFocus();

    if (JOptionPane.showOptionDialog(comp, message, GettextResource.gettext(Configuration.getInstance()
        .getI18nResourceBundle(), "Password request"), JOptionPane.OK_CANCEL_OPTION,
        JOptionPane.QUESTION_MESSAGE, null, null, null) == 0) {
      retVal = String.valueOf(passwordField.getPassword());
    }
    return retVal;
  }
View Full Code Here

    private JPasswordDialog()
    {}
   
    public static String showPasswordDialog(Component parent, String title, int passFields, int icon)
    {
        final JPasswordField passwordField = new JPasswordField(passFields);
        JOptionPane pane = new JOptionPane(passwordField, icon, JOptionPane.OK_CANCEL_OPTION);
        JDialog dia = pane.createDialog(parent, title);
        dia.addWindowListener(new WindowAdapter()
        {
            @Override
            public void windowActivated(WindowEvent ev)
            {
                Timer timer = new Timer(50, new ActionListener()
                {
                    public void actionPerformed(ActionEvent ev)
                    {
                       passwordField.requestFocusInWindow();
                    }
                });
                timer.setRepeats(false);
                timer.start();
            }
        });

        dia.setVisible(true);
        return ((Integer)pane.getValue() == JOptionPane.OK_OPTION ? new String (passwordField.getPassword()) : null);
    }
View Full Code Here

    private String initialValue = "";

    protected PasswordEditor() {
        super();

        textField = new JPasswordField();
        textField.addActionListener(this);
        textField.addFocusListener(this);
    }
View Full Code Here

        authTable.getTableHeader().setDefaultRenderer(new HeaderAsPropertyRenderer());
        authTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        authTable.setPreferredScrollableViewportSize(new Dimension(100, 70));

        TableColumn passwordColumn = authTable.getColumnModel().getColumn(AuthManager.COL_PASSWORD);
        passwordColumn.setCellEditor(new DefaultCellEditor(new JPasswordField()));
        passwordColumn.setCellRenderer(new PasswordCellRenderer());

        JPanel panel = new JPanel(new BorderLayout(0, 5));
        panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),
                JMeterUtils.getResString("auths_stored"))); //$NON-NLS-1$
View Full Code Here

        panel.add(proxyUser, BorderLayout.CENTER);
        return panel;
    }

    private JPanel getProxyPassPanel() {
        proxyPass = new JPasswordField(5);

        JLabel label = new JLabel(JMeterUtils.getResString("password")); // $NON-NLS-1$
        label.setLabelFor(proxyPass);

        JPanel panel = new JPanel(new BorderLayout(5, 0));
View Full Code Here

        super(pLabel);
    }

    @Override
    protected JTextField createTextField(int size) {
        return new JPasswordField(size);
    }
View Full Code Here

     */
    private void initGUI() {
        this.urlTextField = new XBayaTextField();
        this.gatewayTextField = new XBayaTextField();
        this.usernameTextField = new XBayaTextField();
        this.passwordTextField = new JPasswordField();
        try {
            if (getPreviousRegURL() != null){
                this.urlTextField.setText(engine.getConfiguration().getRegistryURL().toASCIIString());
            } else if (engine.getConfiguration().isRegURLSetByCMD()){
                this.urlTextField.setText(engine.getConfiguration().getRegistryURL().toASCIIString());
View Full Code Here

                components.add(field);
                continue;
            }
            if (item instanceof CredentialItem.Password) {
                components.add(new JLabel(item.getPromptText()));
                JTextField field = new JPasswordField();
                field.putClientProperty(CRED_ITEM, item);
                components.add(field);
                continue;
            }
            if (item instanceof CredentialItem.StringType) {
                components.add(new JLabel(item.getPromptText()));
                JTextField field;
                if (item.isValueSecure()) {
                    field = new JPasswordField();
                } else {
                    field = new JTextField();
                }
                field.putClientProperty(CRED_ITEM, item);
                components.add(field);
                continue;
            }
            if (item instanceof CredentialItem.InformationalMessage) {
                components.add(new JLabel(item.getPromptText()));
                continue;
            }
            if (item instanceof CredentialItem.YesNoType) {
                JCheckBox field = new JCheckBox(item.getPromptText(), ((CredentialItem.YesNoType) item).getValue());
                field.putClientProperty(CRED_ITEM, item);
                components.add(field);
                continue;
            }
        }
        return components.toArray(new JComponent[components.size()]);
View Full Code Here

TOP

Related Classes of javax.swing.JPasswordField

Copyright © 2018 www.massapicom. 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.