--- 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;
}