Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Mutiple selection of table rows inconsistent  RSS feed

 
Jared Cope
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I recently stated developing our application under Java 1.5 (coming from 1.4.2_06) and I noticed that multiple selection of table rows does not behave the same anymore.

If I hold down ctrl while selection rows, sometimes certain previous selections will get 'unselected', sometimes it will work without error, sometimes I lose all my selections.

Has anyone had similar problems, Is this a known bug in java 1.5?

Cheers, Jared.
 
Jared Cope
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay, it is a bug that is introduced with 1.5. Here is the report from the sun website:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6195469

Seems that a drag event within the table will invalidate any previous selections. Shame.

Cheers, Jared.
 
Jared Cope
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi again,

For people struggling with this, as a workaround, you might like to try this suggestion. It has worked for me because I am not interested in drag events on my table. If you require multiple selection by dragging then this is not for you. Assume this code is in your custom table class (probably constructor).



This will remove the broken mouse motion listeners from your table. I found that my ctrl + mouse clicking went back to normal after this. I hope the bug is fixed soon though.

Cheers, Jared.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!