static String[] instr = { "This test prints two jobs, and tests that the specified range", "of pages is printed. You must have a printer installed for this test.", "In the first dialog, select a page range of 2 to 3, and press OK", "In the second dialog, select ALL, to print all pages (in total 5 pages).", "Collect the two print outs and confirm the jobs printed correctly",
};
publicstaticvoid main(String args[]) throws Exception { for (int i=0;i<instr.length;i++) {
System.out.println(instr[i]);
}
PrinterJob job = PrinterJob.getPrinterJob(); if (job.getPrintService() == null) {
System.out.println("No printers. Test cannot continue."); return;
}
job.setPrintable(new PageRanges()); if (!job.printDialog()) { return;
}
job.print(); if (!job.printDialog()) { return;
}
job.print();
return;
}
publicint print(Graphics g, PageFormat pf, int pi) throws PrinterException {
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.