document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. import javafx.application.Application;
  2. import javafx.scene.Scene;
  3. import javafx.scene.image.Image;
  4. import javafx.scene.image.ImageView;
  5. import javafx.scene.layout.StackPane;
  6. import javafx.stage.Stage;
  7. /**
  8. *
  9. * @author zoranpavlovic.blogspot.com
  10. */
  11. public class LoadImage extends Application {
  12.     /**
  13.     * @param args the command line arguments
  14.     */
  15.     public static void main(String[] args) {
  16.     Application.launch(args);
  17.     }
  18.     @Override
  19.     public void start(Stage primaryStage) {
  20.     primaryStage.setTitle("Load Image");
  21.        
  22.     StackPane sp = new StackPane();
  23.     Image img = new Image("javafx.jpg");
  24.     ImageView imgView = new ImageView(img);
  25.     sp.getChildren().add(imgView);
  26.    
  27.     //Adding HBox to the scene
  28.     Scene scene = new Scene(sp);
  29.     primaryStage.setScene(scene);
  30.     primaryStage.show();
  31. }
  32. }
');