public static TitledGroupBg addTitledGroupBg( GridPane gridPane, int rowIndex, int rowSpan, String title, double top) { TitledGroupBg titledGroupBg = new TitledGroupBg(); titledGroupBg.setText(title); titledGroupBg.prefWidthProperty().bind(gridPane.widthProperty()); GridPane.setRowIndex(titledGroupBg, rowIndex); GridPane.setRowSpan(titledGroupBg, rowSpan); GridPane.setColumnSpan(titledGroupBg, 2); GridPane.setMargin(titledGroupBg, new Insets(top, -10, -10, -10)); gridPane.getChildren().add(titledGroupBg); return titledGroupBg; }