Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTable help needed

 
Arun Sharma
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi:
I am facing this problem. I have a JTable with 4 colums and textfield for each cell noneditable. I want to highlight the first row as soons as the table comes up. I am not sure how to do it. I tried requestFocus() doesnt work. Please help me.
Thanks in advance.
Sam
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
setRowSelectionInterval( int index0, int index1 ) should work... it's a method on JTable that selects the rows from index0 to index1, inclusive.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic