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

JDK 1.3: ImageIcon.toString() returns null, causing JCK 1.3a test failure

XMLWordPrintable

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


      This bug is being reported in order to have a public record of a JDK 1.3
      bug that causes a JCK 1.3a test to be excluded.

      In JDK 1.3, if an ImageIcon is created using the ImageIcon(Image) constructor,
      the ImageIcon.toString() method returns a null value.

      This causes the JCK 1.3a test
      api/javax_swing/interactive/JComboBoxTests.html#JComboBox
      (testcase JComboBoxTest0004) to fail against JDK 1.3.
      The following NullPointerException is thrown when the <SHIFT> key is pressed
      over the JComboBox:
        Exception occurred during event dispatching:
          java.lang.NullPointerException
           at
      javax.swing.JComboBox$DefaultKeySelectionManager.selectionForKey(JComboBox.java:1166)
           at javax.swing.JComboBox.selectWithKeyChar(JComboBox.java:991)
           at javax.swing.plaf.basic.BasicComboBoxUI$KeyHandler.keyPressed(BasicComboBoxUI.java:390)
           at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:190)
           at java.awt.Component.processKeyEvent(Component.java:3677)
           at javax.swing.JComponent.processKeyEvent(JComponent.java:2014)
           at java.awt.Component.processEvent(Component.java:3553)
           at java.awt.Container.processEvent(Container.java:1164)
           at java.awt.Component.dispatchEventImpl(Component.java:2593)
           at java.awt.Container.dispatchEventImpl(Container.java:1213)
           at java.awt.Component.dispatchEvent(Component.java:2497)
           at java.awt.LightweightDispatcher.processKeyEvent(Container.java:2155)
           at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2135)
           at java.awt.Container.dispatchEventImpl(Container.java:1200)
           at java.awt.Window.dispatchEventImpl(Window.java:926)
           at java.awt.Component.dispatchEvent(Component.java:2497)
           at java.awt.EventQueue.dispatchEvent(EventQueue.java:339)
           at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:131)
           at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:98)
           at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
           at java.awt.EventDispatchThread.run(EventDispatchThread.java:85)

      The attached test program demonstrates the bug.
      If JDK 1.3 is used, a null value is returned by ImageIcon.toString().
      If JDK 1.4 is used, a non-null value is returned by this method.

            svioletsunw Scott Violet (Inactive)
            gaurisha Gauri Sharma (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: