This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to be notified about selected row change? i mean user selected other row of jtabl  RSS feed

 
raminaa niilian
Ranch Hand
Posts: 551
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Thank you for reading my post
I have a jtable with some rows , now i want to do some operation when user navigate in rows
for example :
by using up/down arrow key selects other rows i can be notified (is there any event listener for selected
row changes , if so can you tell me how to use it)

Thanks
 
Stuart Gray
Ranch Hand
Posts: 410
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to get the ListSelectionModel from your JTable, and then add a ListSelectionListener to it. There is a useful section in the Sun tutorial on this: http://java.sun.com/docs/books/tutorial/uiswing/components/table.html
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!