src/macosx/classes/sun/lwawt/LWWindowPeer.java

Print this page

        

@@ -165,14 +165,10 @@
         platformWindow.initialize(target, this, ownerDelegate);
     }
 
     @Override
     public void initialize() {
-        super.initialize();
-
-        updateInsets(platformWindow.getInsets());
-
         if (getTarget() instanceof Frame) {
             setTitle(((Frame)getTarget()).getTitle());
             setState(((Frame)getTarget()).getExtendedState());
         } else if (getTarget() instanceof Dialog) {
             setTitle(((Dialog)getTarget()).getTitle());

@@ -184,12 +180,13 @@
         cachedFocusableWindow = getTarget().isFocusableWindow();
 
         setOpacity(getTarget().getOpacity());
         setOpaque(getTarget().isOpaque());
 
-        // Create surface data and back buffer
-        replaceSurfaceData(1, null);
+        super.initialize();
+
+        updateInsets(platformWindow.getInsets());
     }
 
     // Just a helper method
     public PlatformWindow getPlatformWindow() {
         return platformWindow;

@@ -437,22 +434,24 @@
     }
 
     @Override
     public void setOpacity(float opacity) {
         getPlatformWindow().setOpacity(opacity);
+        repaintPeer();
     }
 
     @Override
-    public void setOpaque(boolean isOpaque) {
+    public final void setOpaque(final boolean isOpaque) {
         if (this.isOpaque != isOpaque) {
             this.isOpaque = isOpaque;
             getPlatformWindow().setOpaque(isOpaque);
             replaceSurfaceData();
+            repaintPeer();
         }
     }
 
-    public boolean isOpaque() {
+    public final boolean isOpaque() {
         return isOpaque;
     }
 
     @Override
     public void updateWindow() {

@@ -1052,10 +1051,11 @@
             insets = newInsets;
         }
 
         if (changed) {
             replaceSurfaceData();
+            repaintPeer();
         }
 
         return changed;
     }