get JavaFX Image from path - Java JavaFX

Java examples for JavaFX:Image

Description

get JavaFX Image from path

Demo Code


import javafx.scene.image.Image;
import javafx.scene.image.ImageView;

public class Main{
    public static Image getImage(String path) {
        return new Image(FXUtils.class.getResourceAsStream(path));
    }//from  ww w . j  a va  2s  .  com
}

Related Tutorials