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

JPassword does not work properly when the following code is used

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P5 P5
    • None
    • 1.3.0
    • client-libs



      Name: skT45625 Date: 05/19/2000


      java version "1.3.0"
      Jave(TM) 2 Runtime Environment, Standard Edition (buld 1.3.0-C)
      Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)

      when using method setEchoChar method of JPassword field
      divide by zero exception is thrown when attempting to click on password
      it is possible to get to the JPassword by pressing on TAB key,
      in that case when entering password only the first character is seen

      code example:
      //////////////////////////////

      import javax.swing.*;

      public class TestPassword extends JFrame{
          private JPasswordField normalPassword;
          private JPasswordField bugPassword;
          
          public TestPassword(){
              setBounds(200,200,280,460);
              
              normalPassword = new JPasswordField("");
              bugPassword = new JPasswordField("");
              
              getContentPane().setLayout(null);
              
              getContentPane().add(normalPassword);
              getContentPane().add(bugPassword);
              
              normalPassword.setBounds(50,50,100,20);
              bugPassword.setBounds(50,100,100,20);
              
              bugPassword.setEchoChar('\n');
              
              setVisible(true);
          }
       
          public static void main(String args[]){
              new TestPassword();
          }
      }
      (Review ID: 105123)
      ======================================================================

            apikalev Andrey Pikalev
            skondamasunw Suresh Kondamareddy (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: