i want to print something like this
IMAGE
TITLE
JTABLE
i know to print a jtable with the title in a messageFormat header but i dont know how to add the image
The image is a logo
See Question&Answers more detail:osi want to print something like this
IMAGE
TITLE
JTABLE
i know to print a jtable with the title in a messageFormat header but i dont know how to add the image
The image is a logo
See Question&Answers more detail:osYou might try the approach shown here. Use drawImage()
instead of drawString()
in your Image
printable.
private static class Image implements Printable {…}
private static class Title implements Printable {…}
PrinterJob pj = PrinterJob.getPrinterJob();
Book book = new Book();
book.append(new Image(), pj.defaultPage());
book.append(new Title(), pj.defaultPage());
book.append(table.getPrintable(...), pj.defaultPage());
book.append(new EndPage(), pj.defaultPage());
pj.setPageable(book);
pj.print();