I'm just starting to learn how to print a window in Java/Swing. (edit: just found the Java Printing Guide)
When I do this:
protected void doPrint() {
PrinterJob job = PrinterJob.getPrinterJob();
job.setPrintable(this);
boolean ok = job.printDialog();
if (ok) {
try {
job.print();
}
catch (PrinterException ex) {
ex.printStackTrace();
}
finally {
}
}
}
I get this printer dialog (on Windows XP):
How do I change the page range so it's not 1-9999?
edit: using Pageable
/Book
to set the page range (as @t_barbz helpfully points out) requires a PageFormat, in which case I have a catch-22, since I'd like the Print dialog to select that, and I don't seem to get a return value from the print dialog.