-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathShowImages.java
44 lines (34 loc) · 1.14 KB
/
ShowImages.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Jonathan Rumley
// CSC_161-101
// September 2020
// Exercise 4 - Java FX
import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Pane;
import javafx.stage.Stage;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
public class ShowImages extends Application {
public static void main(String[] args) {
Application.launch(args);
}
@Override
public void start(Stage primaryStage) throws FileNotFoundException
{
Pane pane = new HBox(10);
pane.setPadding(new Insets(5,5,5,5));
Image image = new Image(new FileInputStream("G:\\csc_161\\HappyHalloween1.jpg"));
Image image2 = new Image(new FileInputStream("G:\\csc_161\\HappyHalloween2.png"));
pane.getChildren().add(new ImageView(image));
ImageView imageView3 = new ImageView(image2);
pane.getChildren().add(imageView3);
Scene scene = new Scene(pane);
primaryStage.setTitle("Show Image");
primaryStage.setScene(scene);
primaryStage.show();
}
}