HI, I use this method to print my JTable with header (Title) and footer (page number):
public static void PrintTable(JTable mytable,
String titletable) {
try {
// fetch the printable
Printable printable = mytable.getPrintable(JTable.PrintMode.FIT_WIDTH,
new MessageFormat(titletable),
new MessageFormat("Page - {0}"));
// fetch a PrinterJob
PrinterJob job = PrinterJob.getPrinterJob();
// set the Printable on the PrinterJob
job.setPrintable(printable);
// create an attribute set to store attributes from the print dialog
PrintRequestAttributeSet attr = new HashPrintRequestAttributeSet();
// display a print dialog and record whether or not the user cancels it
boolean printAccepted = job.printDialog(attr);
// if the user didn't cancel the dialog
if (printAccepted) {
// do the printing (may need to handle PrinterException)
job.print(attr);
}
}
catch(Exception gh){
}
finally {
// restore the original table state here (for example, restore selection)
}
}
it's all ok ... I want change the font size to the TITLE (HEADER) because now print a title with big font size.
Is it possible to do it?
thanks a lot