jdk/src/solaris/classes/sun/awt/X11/XToolkit.java
changeset 8947 35ff89272f4f
parent 6820 bd6e9b4e1460
child 9030 3de293b4cf4f
--- a/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java	Fri Mar 18 15:44:45 2011 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java	Mon Mar 28 15:25:24 2011 +0400
@@ -1222,8 +1222,8 @@
     public PrintJob getPrintJob(final Frame frame, final String doctitle,
                                 final Properties props) {
 
-        if (GraphicsEnvironment.isHeadless()) {
-            throw new IllegalArgumentException();
+        if (frame == null) {
+            throw new NullPointerException("frame must not be null");
         }
 
         PrintJob2D printJob = new PrintJob2D(frame, doctitle, props);
@@ -1236,11 +1236,10 @@
 
     public PrintJob getPrintJob(final Frame frame, final String doctitle,
                 final JobAttributes jobAttributes,
-                final PageAttributes pageAttributes) {
-
-
-        if (GraphicsEnvironment.isHeadless()) {
-            throw new IllegalArgumentException();
+                final PageAttributes pageAttributes)
+    {
+        if (frame == null) {
+            throw new NullPointerException("frame must not be null");
         }
 
         PrintJob2D printJob = new PrintJob2D(frame, doctitle,