Image in header of print (JTable)

Hello,

I have a question about printing a JTable. I use the following code which works well but I want to extend my print with a image (a logo) in the header of every page. What is the best way to achieve this?

My second question is how I can change the font size of the header?

Thanks for your reply.

Regards Stefan.

MessageFormat header =new MessageFormat("Test");

MessageFormat footer =new MessageFormat("Page - {0}");

try{

if (!myTable.print(JTable.PrintMode.FIT_WIDTH

, header, footer, true, null,true)){

System.err.println("User cancelled printing");

}

}catch (java.awt.print.PrinterException e){

System.err.format("Cannot print %s%n", e.getMessage());

}

[1213 byte] By [hes01a] at [2007-11-27 11:49:41]
# 1

The API provided by the JTable class is described as simple, and indeed it is. To obtain more complex printing, you need to use the JTable.getPrintable method and do some extra work to get the results desired.

There are also several third party codes you can try. Do a search on google to search what you find

ICE

icewalker2ga at 2007-7-29 18:26:46 > top of Java-index,Desktop,Core GUI APIs...