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

java.lang.NullPointerException is throws when a container contains a TextField in build 74.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P1
    • Resolution: Duplicate
    • Affects Version/s: 6
    • Fix Version/s: None
    • Component/s: client-libs
    • Labels:

      Description

      Any Container that contains TextField results in java.lang.NullPointerException.
      This effects some of the important compontents like FileChooser etc. Because of this bug the client application may not startup. As this is a critical issue so Please fix it as early as possible.

      This is reproduable only in Mustang b74 on solaris & linux (RHEL4.0). This may be reproduce because of the 4985353 bug which was fixed in Swing PIT request for 6.0 B74.

      Step to Reproduce:-
      --------------------
      1) Run the attached program ( TestFrame.java)
      2) You can see a java.lang.NullPointerException as follows
      javabash-3.00$ java -showversion TestFrame
      java version "1.6.0-beta2"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.6.0-beta2-b74)
      Java HotSpot(TM) Server VM (build 1.6.0-beta2-b74, mixed mode)

      java.awt.Frame[frame0,0,0,400x400,invalid,hidden,layout=java.awt.BorderLayout,title=Testing Frame,resizable,normal]
      java.lang.NullPointerException
              at javax.swing.JPasswordField.customSetUIProperty(JPasswordField.java:337)
              at javax.swing.LookAndFeel.installProperty(LookAndFeel.java:150)
              at javax.swing.plaf.basic.BasicPasswordFieldUI.installDefaults(BasicPasswordFieldUI.java:58)
              at javax.swing.plaf.basic.BasicTextUI.installUI(BasicTextUI.java:686)
              at javax.swing.plaf.basic.BasicTextFieldUI.installUI(BasicTextFieldUI.java:57)
              at sun.awt.X11.XTextFieldPeer$AWTTextFieldUI.installUI(XTextFieldPeer.java:493)
              at javax.swing.JComponent.setUI(JComponent.java:613)
              at sun.awt.X11.XTextFieldPeer$XAWTTextField.updateUI(XTextFieldPeer.java:660)
              at javax.swing.text.JTextComponent.<init>(JTextComponent.java:305)
              at javax.swing.JTextField.<init>(JTextField.java:207)
              at javax.swing.JPasswordField.<init>(JPasswordField.java:116)
              at javax.swing.JPasswordField.<init>(JPasswordField.java:74)
              at sun.awt.X11.XTextFieldPeer$XAWTTextField.<init>(XTextFieldPeer.java:604)
              at sun.awt.X11.XTextFieldPeer.<init>(XTextFieldPeer.java:59)
              at sun.awt.X11.XToolkit.createTextField(XToolkit.java:757)
              at java.awt.TextField.addNotify(TextField.java:205)
              at java.awt.Container.addNotify(Container.java:2500)
              at java.awt.Window.addNotify(Window.java:528)
              at java.awt.Frame.addNotify(Frame.java:479)
              at java.awt.Window.show(Window.java:711)
              at java.awt.Component.show(Component.java:1406)
              at java.awt.Component.setVisible(Component.java:1359)
              at java.awt.Window.setVisible(Window.java:694)
              at TestFrame.initializeGUI(TestFrame.java:30)
              at TestFrame.<init>(TestFrame.java:7)
              at TestFrame.main(TestFrame.java:38)


      Because of the TextField FileChooser also effects.
      Step to reproduce:
      --------------------
      1) Run the attached program. (TestFileChooser.java)
      2) click on the "Open" button.
      3) You can exception as follows.
      bash-3.00$ java -showversion TestFileChooser
      java version "1.6.0-beta2"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.6.0-beta2-b74)
      Java HotSpot(TM) Server VM (build 1.6.0-beta2-b74, mixed mode)

      java.awt.Frame[frame0,0,0,400x400,invalid,hidden,layout=java.awt.BorderLayout,title=Testing Frame,resizable,normal]
      java.awt.Frame[frame0,0,0,400x400,layout=java.awt.BorderLayout,title=Testing Frame,resizable,normal]
      action performed...
      Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
              at javax.swing.JPasswordField.customSetUIProperty(JPasswordField.java:337)
              at javax.swing.LookAndFeel.installProperty(LookAndFeel.java:150)
              at javax.swing.plaf.basic.BasicPasswordFieldUI.installDefaults(BasicPasswordFieldUI.java:58)
              at javax.swing.plaf.basic.BasicTextUI.installUI(BasicTextUI.java:686)
              at javax.swing.plaf.basic.BasicTextFieldUI.installUI(BasicTextFieldUI.java:57)
              at sun.awt.X11.XTextFieldPeer$AWTTextFieldUI.installUI(XTextFieldPeer.java:493)
              at javax.swing.JComponent.setUI(JComponent.java:613)
              at sun.awt.X11.XTextFieldPeer$XAWTTextField.updateUI(XTextFieldPeer.java:660)
              at javax.swing.text.JTextComponent.<init>(JTextComponent.java:305)
              at javax.swing.JTextField.<init>(JTextField.java:207)
              at javax.swing.JPasswordField.<init>(JPasswordField.java:116)
              at javax.swing.JPasswordField.<init>(JPasswordField.java:74)
              at sun.awt.X11.XTextFieldPeer$XAWTTextField.<init>(XTextFieldPeer.java:604)
              at sun.awt.X11.XTextFieldPeer.<init>(XTextFieldPeer.java:59)
              at sun.awt.X11.XToolkit.createTextField(XToolkit.java:757)
              at java.awt.TextField.addNotify(TextField.java:205)
              at java.awt.Container.addNotify(Container.java:2500)
              at java.awt.Panel.addNotify(Panel.java:71)
              at java.awt.Container.addImpl(Container.java:1052)
              at java.awt.Container.add(Container.java:352)
              at sun.awt.X11.XFileDialogPeer.addComponent(XFileDialogPeer.java:313)
              at sun.awt.X11.XFileDialogPeer.init(XFileDialogPeer.java:196)
              at sun.awt.X11.XFileDialogPeer.show(XFileDialogPeer.java:718)
              at java.awt.Dialog.conditionalShow(Dialog.java:912)
              at java.awt.Dialog.show(Dialog.java:1027)
              at java.awt.Component.show(Component.java:1406)
              at java.awt.Component.setVisible(Component.java:1359)
              at java.awt.Window.setVisible(Window.java:694)
              at java.awt.Dialog.setVisible(Dialog.java:978)
              at TestFileChooser$1.actionPerformed(TestFileChooser.java:18)
              at java.awt.Button.processActionEvent(Button.java:388)
              at java.awt.Button.processEvent(Button.java:356)
              at java.awt.Component.dispatchEventImpl(Component.java:4378)
              at java.awt.Component.dispatchEvent(Component.java:4208)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
              at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
              at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
              at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                shickeysunw Shannon Hickey (Inactive)
                Reporter:
                lpremkumsunw Lawrence Premkumar1 (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: