Solved

Automatically scroll to the selected row in JTable/JScrollPane

Posted on 2004-08-31
2
900 Views
Last Modified: 2012-06-27
I have a program that populates values in a JTable, then sets then selected row. That works fine, but if the number of rows visible without scrolling is say 10 for example, and the the selected row of the table is 90, you need to either scroll manually to see the selection, or press up arrow key, to scroll semi-automatically. Is it possible to have the JScrollPane automatically scroll the the proper position to display the selected row of the JTable?

Thank you.
0
Comment
Question by:r0ckteacher
2 Comments
 
LVL 35

Expert Comment

by:girionis
Comment Utility
0
 
LVL 92

Accepted Solution

by:
objects earned 50 total points
Comment Utility
table.scrollRectToVisible(table.getCellRect(row, 0, false));
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now