6826074: JScrollPane does not revalidate the component hierarchy after scrolling
Reviewed-by: anthony
--- a/jdk/src/share/classes/javax/swing/DefaultDesktopManager.java Thu Feb 24 16:29:42 2011 +0900
+++ b/jdk/src/share/classes/javax/swing/DefaultDesktopManager.java Mon Feb 28 18:20:34 2011 +0300
@@ -174,6 +174,8 @@
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 @@
/** This moves the <code>JComponent</code> 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 <b>f</b> is necessary. */
--- a/jdk/src/share/classes/javax/swing/JViewport.java Thu Feb 24 16:29:42 2011 +0900
+++ b/jdk/src/share/classes/javax/swing/JViewport.java Mon Feb 28 18:20:34 2011 +0300
@@ -1111,6 +1111,8 @@
view.setLocation(newX, newY);
repaintAll = false;
}
+ // we must validate the hierarchy to not break the hw/lw mixing
+ revalidate();
fireStateChanged();
}
}