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

Actions in a TextArea does result in a layout pass.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 8u45
    • javafx

      Selecting or simply moving the cursor in a TextArea seems to initiate a layout pass on Scene level.

      Assume the following test application:

      import javafx.application.Application;
      import javafx.scene.Node;
      import javafx.scene.Scene;
      import javafx.scene.control.TextArea;
      import javafx.scene.layout.StackPane;
      import javafx.stage.Stage;

      public class Main extends Application {
      public static void main(String[] args) {
      launch(args);
      }

      @Override
      public void start(Stage primaryStage) {
      primaryStage.setScene(new Scene(new NotifyingPane(new StackPane(new StackPane(new StackPane(new TextArea("Test TextArea")))))));
      primaryStage.setTitle("JavaFX Layout Test");
      primaryStage.show();
      }

      private static final class NotifyingPane extends StackPane {
      public NotifyingPane(Node... pChildren) {
      super(pChildren);
      }

      @Override
      protected void layoutChildren() {
      System.out.println("layoutChildren");
      super.layoutChildren();
      }

      @Override
      public void requestLayout() {
      System.out.println("requestLayout");
      super.requestLayout();
      }
      }
      }

       1. Start the test application.
       2. The text area is focused, move the cursor with the arrow keys.
       3. "requestLayout" is printed twice followed by "layoutChildren".

      I'm not a hundred percent sure about that, but I think that moving the cursor in a TextArea should not initiate a layout pass on Scene level.

            Unassigned Unassigned
            rzenzjfx Robert Zenz (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Imported: