B
beowolf
I'm trying to print a "book" of two tables, each table has 3 pages.
Heres the code:
Printable jtp1= jTable1.getPrintable(JTable.PrintMode.FIT_WIDTH ,
new MessageFormat("jTable1"),null) ;
Printable jtp2= jTable2.getPrintable(JTable.PrintMode.FIT_WIDTH ,
new MessageFormat("jTable2"),null) ;
PrinterJob job = PrinterJob.getPrinterJob();
PageFormat portrait = job.defaultPage();
portrait.setOrientation(PageFormat.PORTRAIT);
Book bk = new Book();
bk.append(jtp1, portrait,3);
bk.append(jtp2, portrait,3);
job.setPageable(bk);
if (job.printDialog()) {
try {
job.print();
} catch (Exception exc) {
}
}
Unfortunately it only prints table1 (jtp1).
I've googled like a fool, but i've not found anything relevant to this
problem:
can anybody help me ?
Thank you
Heres the code:
Printable jtp1= jTable1.getPrintable(JTable.PrintMode.FIT_WIDTH ,
new MessageFormat("jTable1"),null) ;
Printable jtp2= jTable2.getPrintable(JTable.PrintMode.FIT_WIDTH ,
new MessageFormat("jTable2"),null) ;
PrinterJob job = PrinterJob.getPrinterJob();
PageFormat portrait = job.defaultPage();
portrait.setOrientation(PageFormat.PORTRAIT);
Book bk = new Book();
bk.append(jtp1, portrait,3);
bk.append(jtp2, portrait,3);
job.setPageable(bk);
if (job.printDialog()) {
try {
job.print();
} catch (Exception exc) {
}
}
Unfortunately it only prints table1 (jtp1).
I've googled like a fool, but i've not found anything relevant to this
problem:
can anybody help me ?
Thank you