Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Swing / AWT / SWT
Search Coderanch
Advance search
Google search
Register / Login
Win a copy of
Spring Boot in Practice
this week in the
Spring
forum!
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Tim Cooke
Ron McLeod
Jeanne Boyarsky
Paul Clapham
Sheriffs:
Liutauras Vilda
Henry Wong
Devaka Cooray
Saloon Keepers:
Tim Moores
Stephan van Hulst
Tim Holloway
Al Hobbs
Carey Brown
Bartenders:
Piet Souris
Mikalai Zaikin
Himai Minh
Forum:
Swing / AWT / SWT
How to set focus on JTable
Narayanan Jayaraman
Ranch Hand
Posts: 52
posted 19 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
After populating and displaying JTable how to set focus or highlight the first row in the table. ?Thanks
Di Shoe
Greenhorn
Posts: 7
posted 19 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
What you can do is put the table in a ScrollPane, then call:
scrollPane.getVerticalScrollBar().setValue(x); scrollPane.validate();
where the x in setValue(x) is the row # in the table.
I hope this helps.
Abhik Sarkar
Ranch Hand
Posts: 61
posted 19 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
How about...
table.setRowSelectionInterval(0,0)
Hope this helps,
Abhik.
Narayanan Jayaraman
Ranch Hand
Posts: 52
posted 19 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Thanks Abhik. It works fine.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
JTable column non-focusable?
tabbing in JTable
tabbing in JTable
JTable
JTable
More...