public class BoardView extends GridPane {
private final BoardPresenter presenter;
private final SelectorView selector;
public BoardView() {
presenter = new BoardPresenter(this);
displayBoard(presenter.getBoard());
selector = new SelectorView(new SelectorPresenter());
presenter.selectionProperty().addListener((_, _, newValue) -> {
getChildren().remove(selector);
if (newValue == null)
return;
add(selector, newValue.x(), newValue.y());
});
}
The line getChildren().remove get's executed on the application thread and does remove the child.
But the UI doesn't update/repaint because when I resize my window the selector disappears.
When I run my app with debug the ui properly updates but when I don't run it with debug it doesn't