-
Bug
-
Resolution: Fixed
-
P4
-
8
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();
}
}
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();
}
}