I have a Swing form with a custom table inside a JScrollPane (it\'s just a JPanel, not a JTable subclass), and I am trying to get it to print. If I just send the whole frame
you have to print the component without scrollpane. the scrollpane will always only prints the visible content.
if you havent access to the createPanel() Method, and the panel from this method only contains the scrollpane, you can get the component, which the scrollpane contains, in the following way:
JPanel panel = createPanel();
print(((JScrollPane)panel.getComponents()[0]).getViewport());
but if your data is format as a table, you can also about using the JTable. the JTable has a own powerful print() Method. more infos at http://download.oracle.com/javase/tutorial/uiswing/misc/printtable.html