-
Bug
-
Resolution: Fixed
-
P3
-
1.4.0
-
None
-
beta
-
sparc
-
solaris_7
-
Verified
With this code:
Toolkit tk = Toolkit.getDefaultToolkit();
JobAttributes ja = new JobAttributes(); // getDialog == JobAttributes.DialogType.NONE
PageAttributes pa = new PageAttributes();
ja.setDestination(JobAttributes.DestinationType.FILE);
ja.setFileName("jn-resolution");
ja.setDialog(JobAttributes.DialogType.NONE);
PrintJob pj = tk.getPrintJob(null, "finalize", ja, pa);
I get the following exception
java.awt.HeadlessException
at sun.awt.motif.PSPrinterJob.printDialog(PSPrinterJob.java:507)
at sun.java2d.PrintJob2D.printDialog(PrintJob2D.java:103)
at sun.awt.motif.MToolkit.getPrintJob(MToolkit.java:364)
at sun.awt.HeadlessToolkit.getPrintJob(HeadlessToolkit.java:341)
at java_awt_PrintJob.do_getGraphics_1(java_awt_PrintJob.java:66) <--- tk.getPrintJob above.
at java_awt_PrintJob.run(java_awt_PrintJob.java:300)
at headless.bat.BATRunner.doTestForClass(BATRunner.java:34)
at headless.bat.BATRunner.doTestCases(BATRunner.java:46)
at test.run(test.java:6)
at java.lang.Thread.run(Thread.java:488)
According to the javadoc, setting DialogType.NONE will avoid the throwing of HeadlessException.
See attached .tar file for the full test case.
============================
the headless spec has been updated to indicate that PrintJob is not
supported in that mode
phil.race@eng 2000-11-15
=======================
Toolkit tk = Toolkit.getDefaultToolkit();
JobAttributes ja = new JobAttributes(); // getDialog == JobAttributes.DialogType.NONE
PageAttributes pa = new PageAttributes();
ja.setDestination(JobAttributes.DestinationType.FILE);
ja.setFileName("jn-resolution");
ja.setDialog(JobAttributes.DialogType.NONE);
PrintJob pj = tk.getPrintJob(null, "finalize", ja, pa);
I get the following exception
java.awt.HeadlessException
at sun.awt.motif.PSPrinterJob.printDialog(PSPrinterJob.java:507)
at sun.java2d.PrintJob2D.printDialog(PrintJob2D.java:103)
at sun.awt.motif.MToolkit.getPrintJob(MToolkit.java:364)
at sun.awt.HeadlessToolkit.getPrintJob(HeadlessToolkit.java:341)
at java_awt_PrintJob.do_getGraphics_1(java_awt_PrintJob.java:66) <--- tk.getPrintJob above.
at java_awt_PrintJob.run(java_awt_PrintJob.java:300)
at headless.bat.BATRunner.doTestForClass(BATRunner.java:34)
at headless.bat.BATRunner.doTestCases(BATRunner.java:46)
at test.run(test.java:6)
at java.lang.Thread.run(Thread.java:488)
According to the javadoc, setting DialogType.NONE will avoid the throwing of HeadlessException.
See attached .tar file for the full test case.
============================
the headless spec has been updated to indicate that PrintJob is not
supported in that mode
phil.race@eng 2000-11-15
=======================
- relates to
-
JDK-4391493 Specifying DestinationType.FILE or DialogType.NONE in tk.getPrintJob ignored
-
- Closed
-
-
JDK-4285177 RFE: Additional Java 2D printing work
-
- Resolved
-