staticfinal String INSTRUCTIONS = """
Note: You must have a printer installed forthis test. If printer is not available, the test passes automatically.
A JTable with 1000 rows and a print dialog will be shown. If only 1 page is printed,
then press fail else press pass. """;
PrinterJob pj = PrinterJob.getPrinterJob(); if (pj.getPrintService() == null) {
System.out.println("Printer not configured or available."
+ " Test cannot continue.");
PassFailJFrame.forcePass();
}
PassFailJFrame passFailJFrame = new PassFailJFrame(INSTRUCTIONS);
SwingUtilities.invokeAndWait(() -> {
printAllPagesTest(); // add the test frame to dispose
PassFailJFrame.addTestWindow(f);
// Arrange the test instruction frame and test frame side by side
PassFailJFrame.positionTestWindow(f, PassFailJFrame.Position.HORIZONTAL);
f.setVisible(true);
boolean ret; try {
ret = table.print();
} catch (PrinterException ex) {
ret = false;
} if (!ret) {
PassFailJFrame.forceFail("Printing cancelled/failed");
}
});
passFailJFrame.awaitAndCheck();
}
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.