diff --git a/jdk/src/share/classes/javax/swing/DefaultDesktopManager.java b/jdk/src/share/classes/javax/swing/DefaultDesktopManager.java
index 8ab24e56dd7..df3d6eb2ab5 100644
--- a/jdk/src/share/classes/javax/swing/DefaultDesktopManager.java
+++ b/jdk/src/share/classes/javax/swing/DefaultDesktopManager.java
@@ -174,6 +174,8 @@ public class DefaultDesktopManager implements DesktopManager, java.io.Serializab
if(!wasIcon(f)) {
Rectangle r = getBoundsForIconOf(f);
desktopIcon.setBounds(r.x, r.y, r.width, r.height);
+ // we must validate the hierarchy to not break the hw/lw mixing
+ desktopIcon.revalidate();
setWasIcon(f, Boolean.TRUE);
}
@@ -453,11 +455,9 @@ public class DefaultDesktopManager implements DesktopManager, java.io.Serializab
/** This moves the JComponent and repaints the damaged areas. */
public void setBoundsForFrame(JComponent f, int newX, int newY, int newWidth, int newHeight) {
- boolean didResize = (f.getWidth() != newWidth || f.getHeight() != newHeight);
f.setBounds(newX, newY, newWidth, newHeight);
- if(didResize) {
- f.validate();
- }
+ // we must validate the hierarchy to not break the hw/lw mixing
+ f.revalidate();
}
/** Convenience method to remove the desktopIcon of f is necessary. */
diff --git a/jdk/src/share/classes/javax/swing/JViewport.java b/jdk/src/share/classes/javax/swing/JViewport.java
index 80a124a41dc..85f39b37387 100644
--- a/jdk/src/share/classes/javax/swing/JViewport.java
+++ b/jdk/src/share/classes/javax/swing/JViewport.java
@@ -1111,6 +1111,8 @@ public class JViewport extends JComponent implements Accessible
view.setLocation(newX, newY);
repaintAll = false;
}
+ // we must validate the hierarchy to not break the hw/lw mixing
+ revalidate();
fireStateChanged();
}
}