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

NullPointerException X11FontMetrics.stringWidth() causes Swing repaint to stop

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 1.2.0
    • Fix Version/s: 1.0.2
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      1.0.2
    • CPU:
      sparc
    • OS:
      solaris_2.5.1

      Description



      Name: rk38400 Date: 04/20/98


      We have some applications with JButtons using tool tips.
      Sometimes when selecting the buttons we see the following
      exception:

      java.lang.NullPointerException
      at sun.awt.motif.X11FontMetrics.stringWidth(X11FontMetrics.java:167)
      at com.sun.java.swing.plaf.basic.BasicToolTipUI.getPreferredSize(BasicToolTipUI.java:102)
      at com.sun.java.swing.JComponent.getPreferredSize(JComponent.java:705)
      at com.sun.java.swing.ToolTipManager.showTipWindow(ToolTipManager.java:113)
      at com.sun.java.swing.ToolTipManager$insideTimerAction.actionPerformed(ToolTipManager.java:326)
      at com.sun.java.swing.Timer.fireActionPerformed(Timer.java:124)
      at com.sun.java.swing.Timer$DummyComponent.processEvent(Timer.java:309)
      at com.sun.java.swing.Timer$DummyComponent.fireEvent(Timer.java:315)
      at com.sun.java.swing.Timer.fire(Timer.java:289)
      at com.sun.java.swing.TimerQueue$TimerPanel.update(TimerQueue.java:367)
      at java.awt.Component.dispatchEventImpl(Component.java:1725)
      at java.awt.Container.dispatchEventImpl(Container.java:939)
      at java.awt.Component.dispatchEvent(Component.java:1704)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:63)

      Most importantly, after we see this exception we see problems with repaint of Swing "widgets". For
      example, if you select an item in the table, it doesn't become
      visibly selected unless you do something to force a repaint, such as
      miniminizing/maximizing the frame. The same is true if you select a node in
      the tree, or select a menubar item. In the latter case the menu does not appear
      unless you minimize/maximize or do something else to force the repaint.

      This appears to be timing related. The selection of the JButton should cancel the
      tooltip timer, but apparently there is a window small enough where the timer is
      expiring just as the button is being selected.
      (Review ID: 28352)
      ======================================================================

        Attachments

          Activity

            People

            Assignee:
            rschiavisunw Richard Schiavi (Inactive)
            Reporter:
            rkarsunw Ralph Kar (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: