Project 4: Java Image Machine, Part 1

Due: October 31


Write a JavaFX program that will open and display an image file. The class with the main method of the program should be called JIMachine.

The program will have five buttons:

You'll probably want to use a BorderPane and put the image in the middle with the buttons in a pane on one of the edges.

Note that you will need a pointer to the stage to use a FileChooser dialog box with JavaFX. Also, you can pass the File reference you get from the FileChooser to the Image constructor like this:
       new Image(file.toURI().toURL().toExternalForm());
Otherwise you will run into problems if you pass an absolute path to the Image constructor.

The online API documentation for JavaFX 8 is at

Turn in

Make sure that your class(es) are not in a package and that the class with the program's main method is named JIMachine. Put your source file(s) into a jar or zip file and turn in the jar or zip file on Canvas. Your files should not be inside a folder in the jar or zip file, and there should not be any files other than source files and an optional README.txt file. (Files and directories automatically added by the jar utility are okay.) You can include a few small test images if you'd like.


15Open button displays dialog box
30Image appears on screen
15Zoom in
15100% button
15Zoom out