Is it possible to add a JavaFX.Button
on a Label of TitledPane
?
Solution found! Source: javawiki.sowas.com/doku.php?id=javafx:titledpane-with-checkbox
TitledPane titledPane = new TitledPane(); // or TitledPane(null,content)
BorderPane borderPane = new BorderPane();
Label titleOfTitledPane = new Label("SomeText");
Button buttonClose = new Button("X");
borderPane.setCenter(titleOfTitledPane);
borderPane.setLeft(buttonClose);
borderPane.prefWidthProperty().bind(scene.widthProperty().subtract(40));
titledPane.setGraphic(borderPane);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.