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

A SplitPane used inside a TabPane is not being rendered until I resize the Stage

XMLWordPrintable

      Here's a sample program which reproduces the problem.
      If I run and select the "SplitPane Tab", the tab content is not rendered until I resize the Stage.
      Note that this seems to be a regression, as I can reproduce it with Java8 (build 120), but not with Java7.

      import javafx.application.Application;
      import javafx.collections.FXCollections;
      import javafx.collections.ObservableList;
      import javafx.scene.Scene;
      import javafx.scene.control.ListView;
      import javafx.scene.control.SplitPane;
      import javafx.scene.control.Tab;
      import javafx.scene.control.TabPane;
      import javafx.stage.Stage;

      public class SplitPaneSample extends Application {
      public SplitPaneSample() {
      }

      public static void main(String[] args) {
      Application.launch(args);
      }

      @Override
      public void start(Stage stage) {
      SplitPane splitPane = new SplitPane();
      splitPane.getItems().addAll(createListView(), createListView());

      TabPane tabPane = new TabPane();
      Tab splitTab = new Tab("SplitPane Tab");
      splitTab.setContent(splitPane);
      tabPane.getTabs().addAll(new Tab("Empty Tab"), splitTab);

      Scene scene = new Scene(tabPane, 500, 500);
      stage.setScene(scene);
      stage.setTitle("SplitPane Inside TabPane Sample");
      stage.show();
      }

      private ListView<String> createListView() {
      ObservableList<String> items = FXCollections.observableArrayList("Animal", "Mineral", "Vegetable");
      ListView<String> listView = new ListView<String>(items);
      return listView;
      }

      }

            jgiles Jonathan Giles
            sbozianjfx Shant Bozian (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: