Java examples for JavaFX:Button
Setup JavaFX Button
//package com.java2s; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.scene.control.Button; import javafx.scene.image.Image; import javafx.scene.image.ImageView; public class Main { public static void SetupButton(Button button, EventHandler<ActionEvent> event, Image graphic, String css) { ImageView imageView = new ImageView(graphic); button.setGraphic(imageView);// w ww.j a va 2s . c om button.setOnAction(event); button.getStylesheets().add(css); } }