Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8036110

In TextField can only select text visible or to the left of the cursor

    XMLWordPrintable

Details

    • b17
    • windows_7

    Backports

      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.

        Attachments

          Issue Links

            Activity

              People

                alexsch Alexandr Scherbatiy
                webbuggrp Webbug Group
                Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: