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

TextField / TextArea frequently requests relayouts (due to caret blinking)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 8
    • 8
    • javafx

      Run the snippet and notice that a relayouting of the scene is requested constantly.

      public class TestTable extends Application {

      public static void main(String[] args) {
      launch(args);
      }

      @Override
      public void start(Stage primaryStage) throws Exception {
      ComboBox<String> c = new ComboBox<>();
      c.setEditable(true);
      c.setItems(FXCollections.observableArrayList("A","B","C"));
      final HBox hb = new HBox() {
      protected void layoutChildren() {
      super.layoutChildren();
      System.err.println("LAYOUT IS REQUESTED");
      }
      };
      hb.needsLayoutProperty().addListener(new InvalidationListener() {

      @Override
      public void invalidated(Observable observable) {
      if( hb.needsLayoutProperty().get() ) {
      System.err.println("Needs layout is flipped");
      }
      }
      });
      hb.getChildren().add(c);
      Scene s = new Scene(hb,400,400);
      primaryStage.setScene(s);
      primaryStage.show();
      }

      }

            jgiles Jonathan Giles
            tschindl Tom Schindl
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: