Java JPasswordField showPassword(JPasswordField pf, JCheckBox cb)

Here you can find the source of showPassword(JPasswordField pf, JCheckBox cb)

Description

show Password

License

Open Source License

Declaration

public static void showPassword(JPasswordField pf, JCheckBox cb) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import javax.swing.JCheckBox;

import javax.swing.JPasswordField;

public class Main {
    public static void showPassword(JPasswordField pf, JCheckBox cb) {
        if (cb.isSelected()) {
            pf.setEchoChar('\u0000');
        } else {//  w  w  w.  jav a2  s .c  o  m
            pf.setEchoChar('*');
        }
    }
}

Related

  1. makeJPasswordField(Document d, String s, int len, Object listener)