Developing User Interfaces
CMSC 498B
Spring 2002
Prof. Ben Bederson
Project #1
Due February 21, 2001


Purpose

The purpose of this program is to gain familiarity with Java's and C#'s drawing facilities. This is also an exercise in using the I/O and string facilities that you will need in later programs.

The Problem

You must display all GIF and JPEG images found in a directory along with their names. The file name is to be displayed immediately below each image.  The images and titles should be laid out in a grid that reacts to the current window size.  As many images should be laid out horizontally as will fit completely in the window, and as many rows should be created as needed to display all the images.  A vertical scroll bar should allow you to scroll to see the images that are off the screen.  If the window is resized, the images should be relayed out to accommodate the change.  You must write the program once in Java and once in C#.  Each program should look and behave identically (or as close as possible given the differences in some widgets). Your program should put up a window that displays the graphics with a scrollbar.  There should be no other interactivity.  The program should be launched by specifying a required directory name that it should load the images from.

The requirements of the project are:

For the Java version, the only widget classes that you are allowed to use are the JComponent, JFrame and JScrollBar. You must build this assignment from scratch using the Graphics/Graphics2D object to draw and by implementing your own subclass of JComponent.

For the C# version, the only widget classes that you are allowed to use are the Control, Form and VScrollBar. You must build this assignment from scratch using the Graphics object to draw and by implementing your own subclass of Control.

You can test your program with the images in /users/bederson/pub/images on WAM, accessible on the PCs in t:\wam\home\wam\b\e\bederson\pub\images
The files are also available zipped if you want to download them to your local machine in
images.zip

Java Hints

C# Hints

form.Resize += new EventHandler(resizeEventHandler)
...
public void resizeEventHandler(object sender, EventArgs e) {
    Size size = form.ClientSize;
    ...
}

Submitting

Submit your program by creating a zip file of all the source code files related to your project, login to a unix WAM computer, and run the WAM submit program.  This is cource CMSC 498B, Section 0101, Project #1.