I have created a JTable
, added it to the JScrollpane
and added a method
public boolean getScrollableTracksViewportHeight() {
if ( getParent() instanceof JViewport ) {
return ( ( (JViewport) getParent() ).getHeight() > getPreferredSize().height );
}
return false;
}
I also added table.scrollRectToVisible(table.getCellRect(30, 0, true));
However, the scrollbar is at the top of the table. Is there a way so that I can move it to end of the table always when opening a table?