src/java.desktop/windows/classes/sun/awt/windows/WPrintDialog.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -56,19 +56,18 @@
     final void setPeer(final ComponentPeer p){
         AWTAccessor.getComponentAccessor().setPeer(this, p);
     }
 
     @Override
-    @SuppressWarnings("deprecation")
     public void addNotify() {
         synchronized(getTreeLock()) {
             Container parent = getParent();
-            if (parent != null && parent.getPeer() == null) {
+            if (parent != null && !parent.isDisplayable()) {
                 parent.addNotify();
             }
 
-            if (getPeer() == null) {
+            if (!isDisplayable()) {
                 ComponentPeer peer = ((WToolkit)Toolkit.getDefaultToolkit()).
                     createWPrintDialog(this);
                 setPeer(peer);
             }
             super.addNotify();