CISC370-010 Project 4


Assigned: June 27, 2001; Due: July 9, 2001
Displaying our Animals in a GUI
This project counts for 10% of the overall grade

Summary

In this project, we will continue to work with streams and files using the animal database from project 3. However, in this project we will have a Graphical User Interface (GUI) instead of a text based one.

Objective

The main objective of this project is to learn how to do GUI programming in Java using swing classes. More input checking will also be done.

The GUI!

This project involves making a GUI for the previous project (Recall the database management program). We will still read our Animals from a file (and save them there as well). To display the Animals, we will use a JEditorPane (See Vol. II of the text and/or go here) which has capabilities to display HTML files (or Strings too). The first step in this project is to implement a toHTML() method that is similar to the toString from project 2, just extended to display our Animal information in HTML (so copy your Animal classes from the previous project to a new directory for this project). For help on HTML see links from class web page, or others.
The next step is to actually create the GUI and all of its features. Do the GUI by hand (do not use the Forte' suite or anything similar- we will not give credit for such code). Use the layout manager(s) of your choice, a combination of GridBag and Border is suggested. Your GUI should look nice and be functional. The exact look is up to you, as long as it implements the requirements stated below. The JEditorPane should be set so the user cannot edit its contents and also be enclosed in a JScrollPane (for possible horizontal and vertical scrolling).


Here is a sample GUI:



Here is a picture of the GUI getting ready to accept input:

Here are the functions the program must do (Formally):

More on toHTML()

This method should be implemented in each class in a similar way that toString is, except it should return a String which contains info on the Animal in HTML (to display in the JEditerPane). For an example string that should get returned, see this. This method should use super just as we did with toString(), just wth some HTML formatting added.

Turn In:


Help with jar:

To create a jar file, simply do (in the directory that contains your project 4 work directory):

jar cf project4.jar proj4

This assumes that proj4 is the name of the directory your project is in and that you want to put it into a project4.jar file.
To verify that the table of contents of your jar file is correct do:

jar tvf project4.jar

An example GUI

For an example GUI, using swing with the GridBag and Border layouts, for the ROI application from the first project go here.

Grading

  1. Working GUI - 80%
  2. GUI works with database file submitted - 10%
  3. JavaDoc on WebPage - 10%