I have the following code for my JavaFX Button.
Button playButton = new Button("Play");
playButton.setLayoutX(980);
playButton.setLayoutY(rectangle.getLayoutY());
playButton.setFont(new Font(45));
playButton.setTextFill(Color.BLACK);
playButton.setPrefSize(200, 125);
playButton.setStyle("-fx-border-color:black;" + "-fx-border-width: 3 3 3 3");
playButton.setBackground(new Background(blackJackBackgroundImage));
playButton.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
}
});
m_layout.getChildren().add(playButton);
I want that when you hover over the button that the color of the text and the border turns gray. How can I do that?