Hello
I have a panel with a JTable that I need to print. Printing from the
panel is no problem, that works fine. The problem is that I have to
print the JTable from an other class that implements Printable since I
have to customize the columns/rows first before printing. I pass the
JTable to the printing class and use the model from the "old" JTable
in the "new" JTable.
When I make a preview of the customized JTable all the data is shown
in the JTable. This is used for testing purposes only, the JTable
should be printed without any preview.
But when I print the JTable only the headers are printed, not the
values in the rows. I debugged it and the cells contains the values as
they are supposed to. Does anyone have an idea of what the problem
might be?
One way to solve it would be to clone the JTable, but I don't know
how.
Tia
András
jtima123 - 12 May 2004 06:41 GMT
Here is the easiest and most convenient printing and PDF generation
solution for free.
Look at the "Smart JPrint" JTable printing APIs provided at: <a
href='http://www.activetree.com'>http://www.activetree.com</a>.
It not only prints the Swing contents such as JTable, JTextArea,
JTextPane, JEditorPane etc., but alos generates
PDF output for the same. You can use the SmartJPrint APIs to preview the
output pages in a preview window, print
from the preview pages and generate PDF. Useful for both J2EE server
programs and Java Swing GUI programs.