Issue Details (XML | Word | Printable)

Key: SWINGX-1275
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: kleopatra
Reporter: trejkaz
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
swingx

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

Created: 24/Feb/10 02:48 PM   Updated: 10/Jan/11 06:24 AM   Resolved: 10/Jan/11 06:24 AM
Component/s: TreeTable
Affects Version/s: 1.6
Fix Version/s: 1.6.3

Time Tracking:
Not Specified

Environment:

Operating System: All
Platform: All


Issuezilla Id: 1,275
Tags:
Participants: Karl Schaefer, kleopatra and trejkaz


 Description  « Hide

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)



Karl Schaefer added a comment - 24/Feb/10 07:50 PM

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

Karl


trejkaz added a comment - 25/Feb/10 03:44 PM

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.


kleopatra added a comment - 10/Jan/11 06:24 AM

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