import javafx.application.Application; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.scene.SceneBuilder; import javafx.scene.control.*; import javafx.stage.Stage; import javafx.stage.StageBuilder; import javafx.util.Callback; /** * * @author Alexander Kouznetsov */ public class Bug extends Application { public static void main(String[] args) { launch(args); } @Override public void start(Stage stage) throws Exception { ObservableList items = FXCollections.observableArrayList(); for (int i = 0; i < 1000; i++) { items.add(i); } Callback, ListCell> cellFactory = new Callback, ListCell>() { @Override public ListCell call(ListView p) { return new ListCell() { { setGraphic(ButtonBuilder.create() .text("abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz ") .maxWidth(100) .build()); } }; } }; StageBuilder.create() .scene( SceneBuilder.create() .width(500) .height(500) .root( ListViewBuilder.create() .items(items) .cellFactory(cellFactory) .build() ) .build()) .applyTo(stage); stage.show(); } }