答案 0 :(得分:1)
你可以这样做:
@Override
public void start(Stage stage)
{
final BorderPane p = new BorderPane();
Stage dialog = new Stage();
dialog.initModality(Modality.APPLICATION_MODAL);
dialog.setScene(new Scene(new Button("TEXT")));
final Button bt = new Button( "LAUNCH" );
bt.setOnAction( e -> dialog.show() );
p.setCenter( bt );
stage.setScene( new Scene( p ));
stage.show();
}
答案 1 :(得分:1)
使用此选择器在与您的类相同的包中定义样式文件“ style.css”:
.dialog-pane > .button-bar > .container {
-fx-padding: 0;
}
在Java代码中设置样式表:
dialog.getDialogPane().getStylesheets().add(getClass().getResource("style.css").toExternalForm());