JDK-8036110 : In TextField can only select text visible or to the left of the cursor
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 7u21
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_7
  • Submitted: 2013-05-12
  • Updated: 2016-03-08
  • Resolved: 2014-05-23
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 8 JDK 9
8u20 b17Fixed 9Fixed
Related Reports
Relates :  
Relates :  
Description
FULL PRODUCT VERSION :
1.7.0_21-b11

ADDITIONAL OS VERSION INFORMATION :
Windows 7 (Version 6.1.7601)

A DESCRIPTION OF THE PROBLEM :
In a TextField one can only select text visible or to the left of the cursor.

REGRESSION.  Last worked in version 6u45

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the applet for which source code is given below, displayed at http://www.segal.org/java/TextFieldSelect

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Selecting text using a mouse beginning at the left ( " One ... " ) should select not only the visible text (One through Eight) but also allow continuing to the right to select the text that is initially not visible initially (including Nine and Ten).
ACTUAL -
Using JRE 1.7.0_21 on Windows, if one tries to select the text by dragging the mouse from the left to the right of the TextField, all the visible text gets highlighted (One through Eight), but the part of the text that is un-displayed on the right does not get selected or copied (Nine and Ten).

On Windows, JRE 6 and possibly early versions of JRE 7, the expected behavior occurred.?One MacOS, JRE 1.7.0_21 and JRE 8 build 89 the expected behavior occurs.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import java.applet.*;
import java.awt.*;

public class TextFieldWithText extends Applet {

public void init()
{
TextField tf = new TextField( " One Two Three Four Five Six Seven Eight Nine Ten " , 30);
add(tf);
}
}  // END OF Class TextFieldWithText
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
Moving to the right of the TextField using the keyboard arrow allows one to select at the end of Ten and then select backwards to include One.?But this should work in both directions, as it did previously on Windows and continues to do on MacOS.
Comments
not a regression in 8 / 9
23-05-2014

GetScrollInfo(hWnd, SB_HORZ, &scrollinfo) returns zero values for the RICHEDIT which does not have WS_HSCROLL style set.
19-05-2014

Release team: Approved for deferral.
11-03-2014

8-defer-request: not a p1, not a jck, not a stopper for jdk 8. Can be fixed in 8u20.
03-03-2014