JDK-6973780 : JCK manual case JTextFieldTests.html#JTextField fails in jdk7 b100
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 7
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2010-08-02
  • Updated: 2012-03-22
  • Resolved: 2011-05-04
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7Resolved
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
Case Name:
api/javax_swing/interactive/JTextFieldTests.html#JTextField(JTextField.jpg)

#case instruction:
This test verifies the behavior of the setColumns() method.A JTextField and a "Number of columns" slider are shown below. Please use the slider to set the number of columns of the testfield, and verify that the number of columns of the textfield changes accordingly.


#actual behavior:
The number of columns of the textfield doesn't changes accordingly.

#verify:
same config jdk7b99 same issue
same config jdk7b101 same issue
JCK-runtime-6b jdk6u21 pass , but with jdk7b100, same issue
JDK/JRE tested: full name of bundle used:  jdk-7-ea-bin-b102-windows-i586-23_jul_2010.exe & jdk-7-ea-bin-b100-windows-i586-09_jul_2010.exe
OS/architecture: x86
Reproducible: Always
Reproducible on machine: winxp-i586 & win7-ultimate-i586
Is it a platform specific regression: N 
Is it a Regression: Not sure 
Steps to reproduce:

Pls see above..

Comments
EVALUATION Since JTextField is a validate root now, the invalidate() call doesn't go up as it used to. We should validate its parent instead.
24-03-2011

EVALUATION There's a problem in the attached test: both the textfield and the fr should be created on the EDT (i.e. in the run() main of the runnbale dispatched to the event queue). However, this is not the root cause of the problem. The real problem is the JTextField.isValidateRoot() method that returns 'true' when the JTextField component is not placed into a JViewport. Therefore, when setColumns() calls revalidate() (or when we do so manually as in the attached test), the invalidate() actually stops on the text field itself. Which means that after the setColumns() call the only invalid component is the textfield. When it comes to validating the hierarchy later, the text field is indeed validated. However, the modified 'columns' property affects its preferred size which should normally cause the text field to resize. But since the text field declares itself as a validate root, its container is not aware of any layout-related information changes in the text field, and as such doesn't resize the textfield correctly. Swing should either not make the JTextField a validate root, or the JTextField should revalidate() its outer container manually when its size-related properties change. Please refer to the specification of the java.awt.Container.isValidateRoot() for details regarding the concept of a 'validate root', and how this status affects components. The CR is re-dispatched to Swing. Also, please note that the issue is reproducible on JDK 1.6.0 FCS, which suggests that the priority of the CR might probably be lower than P2.
14-03-2011

EVALUATION I'm changing the status of this CR to 'Incomplete' until a standalone test that reproduces the issue is provided.
30-11-2010