javafx Adding a graphic to a button

Download javafx for free

Example

Buttons can have a graphic. graphic can be any JavaFX node, like a ProgressBar

button.setGraphic(new ProgressBar(-1));

An ImageView

button.setGraphic(new ImageView("images/icon.png"));

Or even another button

button.setGraphic(new Button("Nested button"));
Adding an action listener