Код: Выделить всё
public class Test extends Application {
@Override
public void start(Stage primaryStage) {
var button = new Button("Push Me");
button.getStyleClass().add("test");
VBox root = new VBox(button);
Scene scene = new Scene(root, 300, 250);
var css = this.getClass().getResource("test.css").toExternalForm();
scene.getStylesheets().add(css);
primaryStage.setScene(scene);
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
Код: Выделить всё
.test {
-fx-effect: ladder(
-fx-background,
dropshadow(three-pass-box, yellow, 8px, 0.6, 0, 2) 49%,
dropshadow(three-pass-box, cyan, 6px, 0.3, 0, 2) 50%);
-fx-text-fill: red;
}
Подробнее здесь: https://stackoverflow.com/questions/789 ... javafx-css