 
import javafx.application.Application;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.stage.Stage;
 
public class IconTest extends Application {
 
    public Parent createContent() {
        final Image icon = new Image("icon.png");
        final Button button = new Button("test", new ImageView(icon));
        return button;
    }
 
    @Override public void start(Stage primaryStage) throws Exception {
        primaryStage.setScene(new Scene(createContent()));
        primaryStage.show();
    }
 
    public static void main(String[] args) {

        launch(args);
    }
}
