When the user hits OK in the PrintDialog – This code works
PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
if (pjob.printDialog(aset)) {
try {
pjob.print(aset);
}
When the user hits OK in the PrintDialog – This code does not work
if (pjob.printDialog()) {
try {
pjob.print();
}
But with the first one it seems like it never gets in to the print method
public int print(Graphics g, PageFormat format, int index) throws PrinterException {
System.out.println("Print\n");
etc...
The print never gets displayed.
This uses a native printer dialog
This one uses a cross platform printer dialog
Where I thought the code was never getting in the print Method was wrong. I was looking in the wrong class to test the code.