Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6852577

Only for Nimbus LAF UIManager.get("PasswordField.echoChar") is null

XMLWordPrintable

    • b19
    • x86
    • windows_vista

      FULL PRODUCT VERSION :
      J2SE 1.6.0_13

      ADDITIONAL OS VERSION INFORMATION :
      Windows Vista SP1 PL

      A DESCRIPTION OF THE PROBLEM :
      I'm using UIManager.get("PasswordField.echoChar") to get the default echo char. I need this default char to allow user to show and hide password.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Character DEFAULT_ECHO_CHARACTER = (Character) javax.swing.UIManager.get("PasswordField.echoChar");

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      DEFAULT_ECHO_CHARACTER != null
      ACTUAL -
      DEFAULT_ECHO_CHARACTER == null

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
          public static void main(String[] args) {
              try {
                  javax.swing.UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
                  System.out.println("Echo char in WindowsLookAndFeel: " + javax.swing.UIManager.get("PasswordField.echoChar"));

                  javax.swing.UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel");
                  System.out.println("Echo char in WindowsClassicLookAndFeel: " + javax.swing.UIManager.get("PasswordField.echoChar"));

                  javax.swing.UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
                  System.out.println("Echo char in MotifLookAndFeel: " + javax.swing.UIManager.get("PasswordField.echoChar"));

                  javax.swing.UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
                  System.out.println("Echo char in MetalLookAndFeel: " + javax.swing.UIManager.get("PasswordField.echoChar"));

                  javax.swing.UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
                  System.out.println("Echo char in NimbusLookAndFeel: " + javax.swing.UIManager.get("PasswordField.echoChar"));
              } catch (Exception ex) {
                  ex.printStackTrace();
              }
          }

      ---------- END SOURCE ----------

            psadhukhan Prasanta Sadhukhan
            igor Igor Nekrestyanov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: