jdk/src/share/classes/javax/swing/JTable.java
changeset 4278 b7a976422d27
parent 4272 f4742294ef29
child 4379 ce28939f55fc
--- a/jdk/src/share/classes/javax/swing/JTable.java	Fri Nov 06 22:33:40 2009 +0300
+++ b/jdk/src/share/classes/javax/swing/JTable.java	Fri Nov 06 22:40:58 2009 +0300
@@ -719,7 +719,7 @@
      * @see #addNotify
      */
     protected void configureEnclosingScrollPane() {
-        JViewport port = SwingUtilities2.getViewport(this);
+        JViewport port = SwingUtilities.getParentViewport(this);
         if (port != null) {
             Container gp = port.getParent();
             if (gp instanceof JScrollPane) {
@@ -728,7 +728,8 @@
                 // example, the rowHeaderView of the scrollPane -
                 // an implementor of fixed columns might do this.
                 JViewport viewport = scrollPane.getViewport();
-                if (viewport == null || viewport.getView() != this) {
+                if (viewport == null ||
+                        SwingUtilities.getUnwrappedView(viewport) != this) {
                     return;
                 }
                 scrollPane.setColumnHeaderView(getTableHeader());
@@ -751,7 +752,7 @@
      * from configureEnclosingScrollPane() and updateUI() in a safe manor.
      */
     private void configureEnclosingScrollPaneUI() {
-        JViewport port = SwingUtilities2.getViewport(this);
+        JViewport port = SwingUtilities.getParentViewport(this);
         if (port != null) {
             Container gp = port.getParent();
             if (gp instanceof JScrollPane) {
@@ -760,7 +761,8 @@
                 // example, the rowHeaderView of the scrollPane -
                 // an implementor of fixed columns might do this.
                 JViewport viewport = scrollPane.getViewport();
-                if (viewport == null || viewport.getView() != this) {
+                if (viewport == null ||
+                        SwingUtilities.getUnwrappedView(viewport) != this) {
                     return;
                 }
                 //  scrollPane.getViewport().setBackingStoreEnabled(true);
@@ -820,7 +822,7 @@
      * @since 1.3
      */
     protected void unconfigureEnclosingScrollPane() {
-        JViewport port = SwingUtilities2.getViewport(this);
+        JViewport port = SwingUtilities.getParentViewport(this);
         if (port != null) {
             Container gp = port.getParent();
             if (gp instanceof JScrollPane) {
@@ -829,7 +831,8 @@
                 // example, the rowHeaderView of the scrollPane -
                 // an implementor of fixed columns might do this.
                 JViewport viewport = scrollPane.getViewport();
-                if (viewport == null || viewport.getView() != this) {
+                if (viewport == null ||
+                        SwingUtilities.getUnwrappedView(viewport) != this) {
                     return;
                 }
                 scrollPane.setColumnHeaderView(null);
@@ -5216,7 +5219,7 @@
      * @see #getFillsViewportHeight
      */
     public boolean getScrollableTracksViewportHeight() {
-        JViewport port = SwingUtilities2.getViewport(this);
+        JViewport port = SwingUtilities.getParentViewport(this);
         return getFillsViewportHeight()
                && port != null
                && port.getHeight() > getPreferredSize().height;