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

GridPane layout of ListViews broken in Lombard

XMLWordPrintable

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

            jgiles Jonathan Giles
            jdenvirjfx James Denvir (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: