package tests; import javafx.application.Application; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.input.KeyEvent; import javafx.stage.Stage; /** * * @author jerome */ public class TestCssIssue extends Application { /** * @param args the command line arguments */ public static void main(String[] args) { Application.launch(args); } @Override public void start(Stage stage) { Scene scene = new Scene(new Group(), 600, 450); Button btn = new Button(); btn.setText("Click Me"); btn.setLayoutX(25); btn.setLayoutY(40); btn.setOnAction(e -> { System.out.println("Event: " + e); btn.setStyle( // "-fx-padding: 14px 20px !important;" // + "-fx-alignment: bottom-right !important;" "-fx-border-width: 1px 0px 0px 0px;" // + "-fx-border-color: #e2e2e2;" // + "-fx-border-style: dashed;" ); }); ((Group) scene.getRoot()).getChildren().add(btn); stage.setScene(scene); stage.show(); } }