--- a/jdk/src/share/classes/javax/swing/JTable.java Wed Apr 21 18:12:21 2010 +0400
+++ b/jdk/src/share/classes/javax/swing/JTable.java Thu Apr 29 18:38:25 2010 +0400
@@ -719,8 +719,9 @@
* @see #addNotify
*/
protected void configureEnclosingScrollPane() {
- JViewport port = SwingUtilities.getParentViewport(this);
- if (port != null) {
+ Container parent = SwingUtilities.getUnwrappedParent(this);
+ if (parent instanceof JViewport) {
+ JViewport port = (JViewport) parent;
Container gp = port.getParent();
if (gp instanceof JScrollPane) {
JScrollPane scrollPane = (JScrollPane)gp;
@@ -752,8 +753,9 @@
* from configureEnclosingScrollPane() and updateUI() in a safe manor.
*/
private void configureEnclosingScrollPaneUI() {
- JViewport port = SwingUtilities.getParentViewport(this);
- if (port != null) {
+ Container parent = SwingUtilities.getUnwrappedParent(this);
+ if (parent instanceof JViewport) {
+ JViewport port = (JViewport) parent;
Container gp = port.getParent();
if (gp instanceof JScrollPane) {
JScrollPane scrollPane = (JScrollPane)gp;
@@ -822,8 +824,9 @@
* @since 1.3
*/
protected void unconfigureEnclosingScrollPane() {
- JViewport port = SwingUtilities.getParentViewport(this);
- if (port != null) {
+ Container parent = SwingUtilities.getUnwrappedParent(this);
+ if (parent instanceof JViewport) {
+ JViewport port = (JViewport) parent;
Container gp = port.getParent();
if (gp instanceof JScrollPane) {
JScrollPane scrollPane = (JScrollPane)gp;
@@ -5217,10 +5220,10 @@
* @see #getFillsViewportHeight
*/
public boolean getScrollableTracksViewportHeight() {
- JViewport port = SwingUtilities.getParentViewport(this);
+ Container parent = SwingUtilities.getUnwrappedParent(this);
return getFillsViewportHeight()
- && port != null
- && port.getHeight() > getPreferredSize().height;
+ && parent instanceof JViewport
+ && parent.getHeight() > getPreferredSize().height;
}
/**