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

NullPointerException occurs in JToolTip in case of JTextField in Metal L&F

XMLWordPrintable


      Kestrel fcs_J on Solaris and Win32 with both of HotSpot and Classic VM.

      NullPointerException occurs when ToolTip is set in a JTextField
      by "setJToolTipText" only with Metal L&F.
      With Motif and Windows L&F(only on Win32) JToolTip works fine.

      However, JToolTip in another component (such as JButton, JRadioButton, JCheckBox, JSlider and so on) works fine with Metal L&F.



      To reproduce;

      1. Compile and run the attached program.
      2. Move mouse pointer to JTextField with Metal L&F.

      Exception as below occurs;

      Exception occurred during event dispatching:
      java.lang.NullPointerException
              at javax.swing.InputMap.allKeys(InputMap.java:186)
              at javax.swing.InputMap.allKeys(InputMap.java:179)
              at javax.swing.JComponent.getRegisteredKeyStrokes(JComponent.java:1575)
              at javax.swing.plaf.metal.MetalToolTipUI.getAcceleratorString(MetalToolTipUI.java:100)
              at javax.swing.plaf.metal.MetalToolTipUI.getPreferredSize(MetalToolTipUI.java:87)
              at javax.swing.JComponent.getPreferredSize(JComponent.java:1044)
              at javax.swing.ToolTipManager.showTipWindow(ToolTipManager.java:231)
              at javax.swing.ToolTipManager$insideTimerAction.actionPerformed(ToolTipManager.java:544)
              at javax.swing.Timer.fireActionPerformed(Timer.java:147)
              at javax.swing.Timer$DoPostEvent.run(Timer.java:105)
              at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:158)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:320)
              at java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:107)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:97)
              at java.awt.EventDispatchThread.run(EventDispatchThread.java:88)

            gsaab Georges Saab
            eishidasunw Etsuko Ishida (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: