From an Applet, trying to do a print using PrintJob.getGraphics() returns 'null'. This happens in Solaris and not in Windows. The same code works fine when running as Application on Solaris.
Code snippet:
//Inside an action handler of a Frame created from Applet
PrintJob pj = getToolkit().getPrintJob(this, "Test Print", null);
if(pj == null) return;
Graphics g = pj.getGraphics(); // <== NULL
Testcase is in the attachment of this bug. Open the demoDefault.html in Netscape browser on Solaris. Click on the Print button from the Frame, which brings up 'Confirmation Needed - Print' dialog (for the 1st time). Click the Yes button to continue, which brings up the 'Print' dialog. Click the OK button to print. Open the Java Console and see java.lang.NullPointerException being thrown.
Code snippet:
//Inside an action handler of a Frame created from Applet
PrintJob pj = getToolkit().getPrintJob(this, "Test Print", null);
if(pj == null) return;
Graphics g = pj.getGraphics(); // <== NULL
Testcase is in the attachment of this bug. Open the demoDefault.html in Netscape browser on Solaris. Click on the Print button from the Frame, which brings up 'Confirmation Needed - Print' dialog (for the 1st time). Click the Yes button to continue, which brings up the 'Print' dialog. Click the OK button to print. Open the Java Console and see java.lang.NullPointerException being thrown.
- duplicates
-
JDK-4930594 UnixPrintServiceLookup should not require file permission
- Resolved
- relates to
-
JDK-2121720 UnixPrintServiceLookup should not require file permission
- Resolved
-
JDK-4673221 printDialog freezes when handling large list of printers in java 1.4
- Resolved