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

How to set focus on JTable

 
Narayanan Jayaraman
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
 
Di Shoe
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.
 
Abhik Sarkar
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