-
Bug
-
Resolution: Fixed
-
P4
-
8
-
MacOSX 10.7.5; JavaFX 2.2.0 under JDK 1.7.0_13 (works correctly); JavaFX 8.0.0-ea-b80 under JDK 8-ea-b80.
In JavaFX 8.0.0, placing a collection of ListViews in a GridPane will not lay them out so they are all visible. In the following code, the ListViews are too large and only one of the four rows is visible. In versions 2.2.x, the lists were resized so that all rows were visible.
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.ListView;
import javafx.scene.layout.GridPane;
import javafx.stage.Stage;
public class ListLayoutTest extends Application {
@Override
public void start(Stage primaryStage) {
GridPane root = new GridPane();
for (int i=0; i<4; i++) {
root.addRow(i, lview(), lview());
}
Scene scene = new Scene(root, 600, 400);
primaryStage.setScene(scene);
primaryStage.show();
}
private ListView<String> lview() {
ListView<String> lview = new ListView<String>();
lview.getItems().addAll("Apples", "Oranges", "Pears");
return lview ;
}
public static void main(String[] args) {
launch(args);
}
}
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.ListView;
import javafx.scene.layout.GridPane;
import javafx.stage.Stage;
public class ListLayoutTest extends Application {
@Override
public void start(Stage primaryStage) {
GridPane root = new GridPane();
for (int i=0; i<4; i++) {
root.addRow(i, lview(), lview());
}
Scene scene = new Scene(root, 600, 400);
primaryStage.setScene(scene);
primaryStage.show();
}
private ListView<String> lview() {
ListView<String> lview = new ListView<String>();
lview.getItems().addAll("Apples", "Oranges", "Pears");
return lview ;
}
public static void main(String[] args) {
launch(args);
}
}
- relates to
-
JDK-8124549 ListView/TableView in VBox breaks layout.
-
- Closed
-