RFR: 6852577: Only for Nimbus LAF UIManager.get("PasswordField.echoChar") is null [v2]

Prasanta Sadhukhan psadhukhan at openjdk.org
Wed Sep 7 16:23:44 UTC 2022


On Tue, 6 Sep 2022 23:12:40 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

> I guess currently the Nimbus L&F use some char for the password field, how that place will intrract with this new ui property?

Added code to interact with the property same way other L&F does. tested with



public class PasswordFieldTest {
        public static void main(String[] args) {
                UIManager.put("PasswordField.echoChar", '@');
                JFrame mainFrame = new JFrame("");
                JPasswordField passwordField = new javax.swing.JPasswordField();
                passwordField.setEnabled(true);
                passwordField.setText("blahblahblah");
                mainFrame.getContentPane().add(passwordField);
                mainFrame.setSize(300,100);
                mainFrame.setVisible(true);
        }
}

-------------

PR: https://git.openjdk.org/jdk/pull/10035



More information about the client-libs-dev mailing list