JScrollPane: how to simulate the user's clicking the scroll bar
I have to print JTables that are within JScrollPanes.
(Unfortunately, we're only at JDK 1.4, not 1.5, so I don't have the new printing methods.)
To print a table, I create a content pane whose height is the paper's imageable height and whose layout is BorderLayout. Then I add the table's scroll pane to this content pane with CENTER, and tell the content pane to print itself.
This works great for a small table, but if the table doesn't fit on 1 page, I need to print each piece of the table on a separate page.
What I need to do is print a pageful of rows,make the scroll pane scroll down to the next series of rows (as if the user had clicked the scroll pane's scroll bar), and print the next page. Then I would repeat the scroll-and-print sequence until I've printed all the rows.
The question is:how do I tell the scroll pane to scroll down AS IF the user had clicked its scroll bar
Also,is there a way to size a JScrollPane so it is exactly long enough to contain the table's header and <n> rows?
Also,is there a way to know how many rows of a table are visible within the scroll pane?
Thanks,
Matt

