边框&背景

Background background = new Background(new BackgroundFill(Paint.valueOf("#088"), new CornerRadii(20), new Insets(10)));
button.setBackground(background);
Border border = new Border(new BorderStroke(Paint.valueOf("#0ff"), BorderStrokeStyle.SOLID, new CornerRadii(20), new BorderWidths(3)));
button.setBorder(border);
Style
button.setStyle(
"-fx-font-size:20;" +
"-fx-text-fill: #fff;" +
"-fx-background-color: #088;" +
"-fx-background-radius:10;" +
"-fx-border-style: solid;" +
"-fx-border-color: #0ff;" +
" -fx-border-width: 3;" +
" -fx-border-radius: 10");

VBox root = new VBox();
root.setStyle("-fx-background-color: #0c8;-fx-background-radius: 20");
root.setPadding(new Insets(60));
root.setSpacing(10);
Button button = new Button("Button");
TextField textField = new TextField();
StackPane stackPane = new StackPane();
stackPane.setPrefWidth(100);
stackPane.setPrefHeight(100);
stackPane.setStyle("-fx-background-color: #88f");
ObservableList<Node> children = root.getChildren();
children.addAll(button, textField, stackPane);
Scene scene = new Scene(root);
scene.setFill(Paint.valueOf("#0000"));
primaryStage.initStyle(StageStyle.TRANSPARENT);
primaryStage.setScene(scene);
primaryStage.getIcons().add(new Image("image\\portrait.jpg"));
primaryStage.setWidth(600);
primaryStage.setHeight(400);
primaryStage.show();