I have a table called table
and its filled with data, I also have a MessageFormat
header I want to use as a header to print the JTable
If you use the getPrintable method instead without adding a header/footer text, you can then include/decorate the returned Printable
in one where you have more control over the header, and where you can specify multi-line headers. See the javadoc of that method which mentions
It is entirely valid for this Printable to be wrapped inside another in order to create complex reports and documents. You may even request that different pages be rendered into different sized printable areas. The implementation must be prepared to handle this (possibly by doing its layout calculations on the fly). However, providing different heights to each page will likely not work well with PrintMode.NORMAL when it has to spread columns across pages.
I have not enough experience with Printable
s to help you further on how to actually do this