Win a copy of Kubernetes in Action this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to set focus on JTable  RSS feed

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After populating and displaying JTable how to set focus or highlight the first row in the table. ?Thanks
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What you can do is put the table in a ScrollPane, then call:

where the x in setValue(x) is the row # in the table.
I hope this helps.
 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about...

Hope this helps,
Abhik.
 
Narayanan Jayaraman
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Abhik. It works fine.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!