I am trying to print an invisivle JTable that contains inner JTables (nested). The outer JTable prints as it should, but for some reason the inner JTables header is never printed, even though everything else of the inner JTables is printed as it should, and that is where the problem is. I have tried everything I can think of without solving it.
I would be happy if someone could help me with this.
Thatnks in advance for any help.
In my code the table is made visible after it is printed to show what it should be like.
Here's my example code:
In general the component should be visible on the screen before attempting to print it.
I believe the header is normally not added to the scrollpane until the scrollpane is made visible on the GUI. It looks like you have bypassed this process by using:
Not sure if the same code will work in the renderer.
If not then maybe the approach used in the Screen Image class will help. Maybe you can just create an image of the table and add it to a JLabel and then print the label. Or maybe invoking the "do layout" code will help somehow.
Joined: Jun 04, 2010
Rob Camick wrote:If not then maybe the approach used in the Screen Image class will help.
Thanks for the help. The approach used in the Screen Image worked great.
subject: Printing invisible JTable containing JTables - problem