Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTable header click event ?

 
Hesham Gneady
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers ,

I wonder is there a way to detect the user clicking on the header of the table so i can execute some code if he did this ?

Thanks ,
Hesham
 
Rob Spoor
Sheriff
Pie
Posts: 20665
65
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JTableHeader can have a MouseListener added just like almost any other control.
 
Hesham Gneady
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Rob ... actually what i was trying to do is do some action after i click on any column header to sort the table.

I thought after the mouseReleased() event for the JTableHeader click the table should have been sorted & i can do the action i want, but i found that the sorting happens after that event.

So is there a way i can detect the table sorting is finished ?

Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic