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

TitledPane cuts content

    XMLWordPrintable

Details

    • Bug
    • Resolution: Not an Issue
    • P4
    • 7u6
    • fx2.1
    • javafx
    • 2.1 b14

    Description

      If I set a pref height on a TitledPane, the content gets cut, if it's height is larger than the TitledPane.

      I am not sure, if this is really a bug, or if I am doing it wrong, but I expected the content to fit the TitledPane's height.

      If the content's min height is larger than the TitlePane, scrollbars should appear.

      And I think it would be ok, if the content grows until its maxHeight.


      import javafx.application.Application;
      import javafx.collections.FXCollections;
      import javafx.geometry.Insets;
      import javafx.scene.Scene;
      import javafx.scene.control.ListView;
      import javafx.scene.control.TitledPane;
      import javafx.scene.layout.VBox;
      import javafx.stage.Stage;


      public class TestApp3 extends Application {
          public static void main(String[] args) throws Exception {
              launch(args);
          }

          public void start(final Stage stage) throws Exception {

              VBox root = new VBox();
              root.setPadding(new Insets(10, 10, 10, 10));

              TitledPane titledPane = new TitledPane();
              titledPane.setCollapsible(false);
              ListView<String> listView = new ListView<String>();
              listView.setItems(FXCollections.observableArrayList("Bla"));
              titledPane.setContent(listView);
              titledPane.setPrefHeight(200);

              root.getChildren().add(titledPane);
              Scene scene = new Scene(root);
              stage.setScene(scene);
              stage.show();
          }
      }

      Attachments

        Activity

          People

            kwwong Kinsley Wong (Inactive)
            cschudtjfx Christian Schudt (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported: