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

Resizing window with TextField hides text value

    XMLWordPrintable

Details

    • b17
    • b15
    • x86_64
    • generic

    Description

      ADDITIONAL SYSTEM INFORMATION :
      Microsoft Windows [Version 10.0.16299.371]
      java version "1.8.0_171"
      Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
      Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)

      A DESCRIPTION OF THE PROBLEM :
      Given a window containing a TextField, and the TextField containing a long String, while the caret is at the end of the String/TextField, and we resize the window right to left, and back again causes the text to disappear.
      Moving the caret to the left allows us to see the String again.

      IMPORTANT: This bug is most notable with Strings that are longer than the TextField, although a curious behavior can observed with Strings slightly shorter than the TextField.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Start the given source code.
      2. Go into the TextField and place the caret right after the 'X' char.
      3. Now resize the window horizontally to be very small and revert.
      4. The text is not visible, because it appears to be outside of the TextField.
      5. Move the caret left via arrow keys to make the text reappear.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Text should automatically reappear if enough space is available.
      ACTUAL -
      No text content visible after resizing. Moving the caret in the TextField to the left make text visible again.

      ---------- BEGIN SOURCE ----------
      public class JavaFXBug extends Application {
        public static void main(String[] args) {
          launch(args);
        }

        @Override
        public void start(Stage primaryStage) {
          Button button = new Button("SomeComponent");
          button.setMinSize(200, 20);
          TextField textField = new TextField("iiiiii iiiii iiiii iiiii iiii ii iiiiii iiiii iiii iiiiiiiX");
          Scene scene = new Scene(new HBox(button, textField));
          primaryStage.setScene(scene);
          primaryStage.show();
        }
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      - Do not resize the window.
      - Provide TextField with a minimal width.

      FREQUENCY : always


      Attachments

        Issue Links

          Activity

            People

              kpk Karthik P K
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: