Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. package net.javainthebox.imageview;
  2.  
  3. import javafx.application.Application;
  4. import javafx.scene.Scene;
  5. import javafx.scene.image.Image;
  6. import javafx.scene.image.ImageView;
  7. import javafx.scene.layout.BorderPane;
  8. import javafx.stage.Stage;
  9.  
  10. public class Main extends Application {
  11.  
  12. @Override
  13. public void start(Stage stage) throws Exception {
  14. BorderPane root = new BorderPane();
  15. ImageView view = new ImageView(new Image("イメージファイルのURL"));
  16. root.setCenter(view);
  17.  
  18. Scene scene = new Scene(root);
  19. stage.setScene(scene);
  20. stage.show();
  21. }
  22.  
  23. public static void main(String[] args) {
  24. launch(args);
  25. }
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement