Package javax.swing

Examples of javax.swing.JPasswordField$PasswordTextKit


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

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

        JPanel panel = new JPanel(new BorderLayout(0, 5));
        panel.setBorder(
            BorderFactory.createTitledBorder(
View Full Code Here


        super(pLabel);
    }

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

        boxLine = new Box(BoxLayout.X_AXIS);
        {
          JLabel jl = new JLabel("Password");
          jl.setPreferredSize(maxSize);
          boxLine.add(jl);
          txtPassword = new JPasswordField(cs.password);
          boxLine.add(txtPassword);
        }
        boxSettings.add(boxLine);

        boxLine = new Box(BoxLayout.X_AXIS);
View Full Code Here

    add(label, txt);
    return txt;
  }

  public JPasswordField makePass(String label, String value) {
    JPasswordField pass = new JPasswordField(value);
    pass.setMaximumSize(maxComponentSize);
    pass.setPreferredSize(preferredTextSize);
    pass.getDocument().addDocumentListener(this);

    add(label, pass);
    return pass;
  }
View Full Code Here

        JLabel hostLab = new JLabel("Host");
        JTextField hostTxt = new JTextField("localhost");
        hostLab.setLabelFor(hostTxt);
       
        JLabel passwordLab = new JLabel("Password");
        JTextField passwordTxt = new JPasswordField("password1");
        passwordLab.setLabelFor(passwordTxt);
       
        JPanel panel = new JPanel();
        panel.setLayout(new GridLayout(4,2));
        panel.add(jidLab);
        panel.add(jidTxt);
        panel.add(usernameLab);
        panel.add(usernameTxt);
        panel.add(hostLab);
        panel.add(hostTxt);
        panel.add(passwordLab);
        panel.add(passwordTxt);
       
        int answer = JOptionPane.showOptionDialog(frame,
                panel,
                "Login",
                JOptionPane.OK_CANCEL_OPTION,
                JOptionPane.QUESTION_MESSAGE,
                null,
                new String[] {"Login", "Exit"},
                "Login");

        if(answer != 0) {
            System.exit(0);
        }
       
        pcm.setUsername(usernameTxt.getText());
        pcm.setHostname(hostTxt.getText());
        pcm.setPassword(passwordTxt.getText());
        pcm.setJID(jidTxt.getText());
    }
View Full Code Here

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

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

        JPanel panel = new JPanel(new BorderLayout(0, 5));
        panel.setBorder(
            BorderFactory.createTitledBorder(
View Full Code Here

      super(pLabel);
   }

   protected void createTextField()
   {
    mTextField = new JPasswordField(30);
   }
View Full Code Here

    authTable.setRowSelectionAllowed(true);
    authTable.setColumnSelectionAllowed(false);
    authTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

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

    // create a JScrollPane and place the auth JTable inside it
    JScrollPane scroller = new JScrollPane(authTable);
    authTable.setPreferredScrollableViewportSize(new Dimension(520, 150));
View Full Code Here

        JLabel hostLab = new JLabel("Host");
        JTextField hostTxt = new JTextField("localhost");
        hostLab.setLabelFor(hostTxt);

        JLabel passwordLab = new JLabel("Password");
        JTextField passwordTxt = new JPasswordField("password1");
        passwordLab.setLabelFor(passwordTxt);

        JPanel panel = new JPanel();
        panel.setLayout(new GridLayout(4, 2));
        panel.add(jidLab);
        panel.add(jidTxt);
        panel.add(usernameLab);
        panel.add(usernameTxt);
        panel.add(hostLab);
        panel.add(hostTxt);
        panel.add(passwordLab);
        panel.add(passwordTxt);

        int answer = JOptionPane.showOptionDialog(frame, panel, "Login", JOptionPane.OK_CANCEL_OPTION,
                JOptionPane.QUESTION_MESSAGE, null, new String[] { "Login", "Exit" }, "Login");

        if (answer != 0) {
            System.exit(0);
        }

        pcm.setUsername(usernameTxt.getText());
        pcm.setHostname(hostTxt.getText());
        pcm.setPassword(passwordTxt.getText());
        pcm.setJID(jidTxt.getText());
    }
View Full Code Here

        addLabelAndValueComponent("Host:Port: ", hostPortComboBox, y++);

        userNameF = new JTextField(24);
        addLabelAndValueComponent("User Name: ", userNameF, y++);

        passwordF = new JPasswordField(24);
        addLabelAndValueComponent("Password: ", passwordF, y++);

        clientIDF = new JTextField(24);
        addLabelAndValueComponent("Client ID: ", clientIDF, y++);
View Full Code Here

TOP

Related Classes of javax.swing.JPasswordField$PasswordTextKit

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.