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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 8
    • Fix Version/s: 8
    • Component/s: javafx
    • Labels:

      Description

      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();
      }

      }

        Attachments

          Activity

            People

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

              Dates

              Due:
              Created:
              Updated:
              Resolved:
              Imported: