This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes JTable help needed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTable help needed" Watch "JTable help needed" New topic

JTable help needed

Arun Sharma
Ranch Hand

Joined: Dec 24, 2003
Posts: 40
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.
Nathan Pruett

Joined: Oct 18, 2000
Posts: 4121

setRowSelectionInterval( int index0, int index1 ) should work... it's a method on JTable that selects the rows from index0 to index1, inclusive.

Write once, run anywhere, because there's nowhere to hide! - /. A.C.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: JTable help needed
It's not a secret anymore!