swingx
  1. swingx
  2. SWINGX-1275

JXTreeTable.getToolTipText(mouseEvent) : IllegalArgumentException: column must be valid, was-1

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.6
    • Fix Version/s: 1.6.3
    • Component/s: TreeTable
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      1,275

      Description

      I'm still not sure exactly how I got this to happen, but I was moving the mouse over a JXTreeTable and
      got the following error. Perhaps instead of throwing IllegalArgumentException, isHierarchical should
      silently return false for indices which are out of bounds?

      Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: column must be valid, was-1
      at org.jdesktop.swingx.JXTreeTable.isHierarchical(JXTreeTable.java:1760)
      at org.jdesktop.swingx.JXTreeTable.getToolTipText(JXTreeTable.java:1197)
      at javax.swing.ToolTipManager$insideTimerAction.actionPerformed(ToolTipManager.java:658)
      at javax.swing.Timer.fireActionPerformed(Timer.java:271)
      at javax.swing.Timer$DoPostEvent.run(Timer.java:201)
      at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
      at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
      at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

        Activity

        Hide
        kleopatra added a comment -

        the problem is in getToolTipText: it doesn't guard against columnAtPoint() being -1, which
        happens if the mouse event is somewhere outside

        fixed as of revision #3913

        • added check for column == -1
        • added test

        Thanks for reporting!
        Jeanette

        Show
        kleopatra added a comment - the problem is in getToolTipText: it doesn't guard against columnAtPoint() being -1, which happens if the mouse event is somewhere outside fixed as of revision #3913 added check for column == -1 added test Thanks for reporting! Jeanette
        Hide
        trejkaz added a comment -

        It seems like the sequence of events is:

        • mouse is in the table somewhere, getting a tooltip (problem is I don't
          remember where - and our table has no tooltips.)
        • timer fires
        • at around the same time, the mouse moves to outside the table, and
          presumably whatever fired the timer off didn't record the original
          position of the mouse, and is instead asking where it is now.
        • columnAtPoint returns -1 because it isn't over a column

        But I can't manually reproduce it as my timing isn't perfect when it needs to be,
        only when it doesn't.

        Show
        trejkaz added a comment - It seems like the sequence of events is: mouse is in the table somewhere, getting a tooltip (problem is I don't remember where - and our table has no tooltips.) timer fires at around the same time, the mouse moves to outside the table, and presumably whatever fired the timer off didn't record the original position of the mouse, and is instead asking where it is now. columnAtPoint returns -1 because it isn't over a column But I can't manually reproduce it as my timing isn't perfect when it needs to be, only when it doesn't.
        Hide
        Karl Schaefer added a comment -

        There is some interaction with the tool tip. Can you please provide a small,
        runnable demo showcasing the problem?

        Karl

        Show
        Karl Schaefer added a comment - There is some interaction with the tool tip. Can you please provide a small, runnable demo showcasing the problem? Karl

          People

          • Assignee:
            kleopatra
            Reporter:
            trejkaz
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: