jdk/src/share/classes/javax/swing/JTable.java
changeset 5449 21bec46ee9e3
parent 4967 da853cd502c8
child 5506 202f599c92aa
child 5590 3ec077d7e893
--- 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;
     }
 
     /**