Example usage for javax.swing JPasswordField echoCharIsSet

List of usage examples for javax.swing JPasswordField echoCharIsSet

Introduction

In this page you can find the example usage for javax.swing JPasswordField echoCharIsSet.

Prototype

public boolean echoCharIsSet() 

Source Link

Document

Returns true if this JPasswordField has a character set for echoing.

Usage

From source file:Main.java

public static void main(String args[]) {
    JFrame f = new JFrame("JPasswordField Sample");
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Box rowOne = Box.createHorizontalBox();
    rowOne.add(new JLabel("Username"));
    rowOne.add(new JTextField());
    Box rowTwo = Box.createHorizontalBox();
    rowTwo.add(new JLabel("Password"));
    JPasswordField jpassword = new JPasswordField();

    rowTwo.add(jpassword);//from ww  w . j  av  a  2s  .c  om
    f.add(rowOne, BorderLayout.NORTH);
    f.add(rowTwo, BorderLayout.SOUTH);
    f.setSize(300, 200);
    f.setVisible(true);

    System.out.println(jpassword.echoCharIsSet());

}