0
TitledPaneのヘッダーのサイズをGridPaneのサイズに合わせる方法はありますか?ここでJavafx TitledPane resizeヘッダー
あなたは、単にCSSファイルで、あなたのTitlePane
ヘッダに固定サイズを設定することができますTitledPane
// --- GridPane container
final Label label = new Label("N/A");
TitledPane gridTitlePane = new TitledPane();
GridPane grid = new GridPane();
gridTitlePane.setStyle("-fx-background-color: #336699;");
gridTitlePane.setPrefSize(parentGrid.getPrefWidth(),parentGrid.getPrefHeight());
gridTitlePane.setText("Statistik");
gridTitlePane.setExpanded(false);
//grid.setVgap(4);
grid.setPadding(new Insets(5, 5, 5, 5));
grid.add(new Label("To: "), 0, 0);
grid.add(new TextField(), 1, 0);
grid.add(new Label("Cc: "), 0, 1);
grid.add(new TextField(), 1, 1);
grid.add(new Label("Subject: "), 0, 2);
grid.add(new TextField(), 1, 2);
grid.add(new Label("Attachment: "), 0, 3);
grid.add(label,1, 3);
gridTitlePane.setStyle("");
gridTitlePane.setContent(grid);
HBox hbox = new HBox();
//HBox.setHgrow(gridTitlePane,Priority.ALWAYS);
//HBox.setHgrow(grid,Priority.ALWAYS);
hbox.getChildren().setAll(gridTitlePane);
'gridTitlePane.setStyle(" - fx-width:100% "、" -fx-height:100% ")'のようにできません。また、IntelliJのアイデア出力ウィンドウのように実行時にペインのサイズを変更することはできますか? – alhelal