Meaningless Drivel is fun!*
The moose likes Swing / AWT / SWT and the fly likes How to set Focus to the first row in a JTable which is inside a JScrollPane Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to set Focus to the first row in a JTable which is inside a JScrollPane" Watch "How to set Focus to the first row in a JTable which is inside a JScrollPane" New topic
Author

How to set Focus to the first row in a JTable which is inside a JScrollPane

Revathi Ba
Greenhorn

Joined: Jul 06, 2012
Posts: 1
I have a JTable inside a JScrollPane. I have put this inside a panel. As soon the panel loads i want the first row in the JTable to get the focus BUT by default the focus goes to the JScrollPane and on pressing tab the focus enters into table's first row.
I dont want to use setRowSelectionInterval(0,0) and setColumnSelectionInterval(0,0) as my requirement is different from that. Kindly help me. Thanks.
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
I see you have your answer here

http://stackoverflow.com/questions/11365294/how-to-set-focus-to-the-first-row-in-a-jtable-which-is-inside-a-jscrollpane

thanks for letting us know
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19697
    
  20

Revathi, please BeForthrightWhenCrossPostingToOtherSites.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
GeeCON Prague 2014
 
subject: How to set Focus to the first row in a JTable which is inside a JScrollPane