Hi guys,
currently I'm encountering a strange behavior while using the PrinterJob class.
I've got a little program printing some pages. Most of the time the printer does its job as it should. But sometimes it takes minutes printing a page which was printed before in seconds.
It's absolutely random and not reproducible.
Following, the gist of the used code.
Where the Printable is a simple class implementing Printable and printing some text using Graphics.
I would be very glad if somebody ran across the same problem before and knows how to fix it.
currently I'm encountering a strange behavior while using the PrinterJob class.
I've got a little program printing some pages. Most of the time the printer does its job as it should. But sometimes it takes minutes printing a page which was printed before in seconds.
It's absolutely random and not reproducible.
Following, the gist of the used code.
Where the Printable is a simple class implementing Printable and printing some text using Graphics.
Code:
private void createPrinterJob(...) {
try {
Printable gp = new Printable( ... );
PrinterJob pjob = PrinterJob.getPrinterJob();
if (pjob.printDialog() == false) {
return;
}
pjob.setPrintable(gp);
pjob.print();
} catch (PrinterException ex) {
ex.printStackTrace();
}
}
Comment