jdk/src/share/classes/javax/swing/JTextField.java
changeset 3737 83fb4621a129
parent 1639 a97859015238
child 4278 b7a976422d27
child 4261 126dc6fe0d7b
--- a/jdk/src/share/classes/javax/swing/JTextField.java	Mon Aug 24 18:21:47 2009 +0400
+++ b/jdk/src/share/classes/javax/swing/JTextField.java	Mon Aug 24 19:22:38 2009 +0400
@@ -24,6 +24,8 @@
  */
 package javax.swing;
 
+import sun.swing.SwingUtilities2;
+
 import java.awt.*;
 import java.awt.event.*;
 import java.beans.*;
@@ -288,11 +290,7 @@
      * @see JComponent#isValidateRoot
      */
     public boolean isValidateRoot() {
-        Component parent = getParent();
-        if (parent instanceof JViewport) {
-            return false;
-        }
-        return true;
+        return SwingUtilities2.getViewport(this) == null;
     }