Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.javainthebox.imageview;
- import javafx.application.Application;
- import javafx.scene.Scene;
- import javafx.scene.image.Image;
- import javafx.scene.image.ImageView;
- import javafx.scene.layout.BorderPane;
- import javafx.stage.Stage;
- public class Main extends Application {
- @Override
- public void start(Stage stage) throws Exception {
- BorderPane root = new BorderPane();
- ImageView view = new ImageView(new Image("イメージファイルのURL"));
- root.setCenter(view);
- Scene scene = new Scene(root);
- stage.setScene(scene);
- stage.show();
- }
- public static void main(String[] args) {
- launch(args);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement