CSE1030 Lab 06

Graphical User Interfaces

Week of Mar 02
Due: Before 11:59PM Mon Mar 10


This lab creates a simple image viewer application using Java Swing and the model-view-controller pattern. In this lab you will:

A Simple Image Viewer

The goal of this lab is to create a simple image viewer application. Before you start writing code, you should try out the final application to see how your completed application should behave. You can run the application from a terminal using the command:

java -jar /cse/dept/www/course/classpath/1030/viewer.jar

The application lets the user open one or more image files (using Open from the File menu). The Previous and Next buttons lets the user traverse the sequence of images. Notice that the application models the sequence of images as having a first image and a last image; the user cannot traverse to the image previous to the first image, nor to the next image after the last image. Opening additional images adds the images to the end of the sequence. The user can also clear all of the images from the sequence (using Clear from the File menu).

The images in the default directory are of Gros Morne National Park and Torngat Mountains National Park in Newfoundland and Labrador ( Newfoundland and Labrador Tourism).

Question 1: Complete the implementation of the view, model, and controller

Complete the implementation of the ViewerView, ViewerModel and ViewerController. The APIs for the various classes can be found here:

Starter code for each class:

The starter code contains many comments to help you complete the implementation. Make sure that your program compiles and runs before you submit.

submit 1030 L6 ViewerModel.java ViewerView.java ViewerController.java