-
Bug
-
Resolution: Not an Issue
-
P4
-
fx2.1
-
2.1 b14
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();
}
}
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();
}
}