Programmatically scrolling to a specific column of a JTable

Hello,

In my applicaiton, I have a frame with a list and a JTable (and the JTable is inside a scroll pane). The list prints all of the column names of the jtable. I'd like it so that when the user selects a column name from the list, the selected column is displayed in the viewport of the scrollpane (if previously it was hidden).

So, for example, if my column headers are "A", "B", ..., "Z", and the viewport containing the jtable currently shows columns "A" through "C". If the user selects "Z" from the list, is it possible to have the scrollpane containing the jtable horizontally scroll such that "Z" is displayed in the viewport?

Message was edited by:

themiddle

[703 byte] By [themiddlea] at [2007-11-27 5:38:23]
# 1
table.scrollRectToVisible(...);
camickra at 2007-7-12 15:11:54 > top of Java-index,Desktop,Core GUI APIs...