-
Bug
-
Resolution: Fixed
-
P4
-
1.3.0, 1.4.0
-
beta
-
generic, x86, sparc
-
generic, solaris_8, windows_nt
-
Verified
I am trying to print a frame to a file using the AWT printing APIs. I am setting the dialog type to NONE and specifying a file name which actually represents a directory, through JobAttributes.setFileName(). I have set the destination type to FILE. When calling frame.printAll() I am getting a NullPointerException on Solaris platform. This is not reproducible on Win32.
This is reproducible right from JDK1.4 on Solaris alone. This is not reproducible when passing a valid file name.
I have attached a sample test. Execute the sample test on Solaris. Enter an absolute path representing a directory in the text field provided. Choose NONE option from the drop-down and click the 'Print' button. If you see the following exception on the console then the bug is reproduced.
java.lang.NullPointerException
at java.awt.Component.printAll(Component.java:2834)
at PrintJobTest.actionPerformed(PrintJobTest.java:47)
at java.awt.Button.processActionEvent(Button.java:388)
at java.awt.Button.processEvent(Button.java:356)
at java.awt.Component.dispatchEventImpl(Component.java:3931)
at java.awt.Component.dispatchEvent(Component.java:3779)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
This is reproducible right from JDK1.4 on Solaris alone. This is not reproducible when passing a valid file name.
I have attached a sample test. Execute the sample test on Solaris. Enter an absolute path representing a directory in the text field provided. Choose NONE option from the drop-down and click the 'Print' button. If you see the following exception on the console then the bug is reproduced.
java.lang.NullPointerException
at java.awt.Component.printAll(Component.java:2834)
at PrintJobTest.actionPerformed(PrintJobTest.java:47)
at java.awt.Button.processActionEvent(Button.java:388)
at java.awt.Button.processEvent(Button.java:356)
at java.awt.Component.dispatchEventImpl(Component.java:3931)
at java.awt.Component.dispatchEvent(Component.java:3779)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
- duplicates
-
JDK-4866027 Printing to File does not throw any error when the specified file is Read-Only
-
- Closed
-
-
JDK-4973281 Invalid file names are not handled properly when printing to file using NONE dlg
-
- Closed
-
- relates to
-
JDK-5009199 PrintService, PrinterJob APIs do not throw any excptn when destination is a dir
-
- Closed
-