Writing a Java applet with components and layouts
This assignment is a substantive one, lasting 3 weeks, and can be thought
of as a "mini-project". The goal of the assignment is to write an applet
which has a user interface of your own design. The requirements are that
it be an applet with layouts of at least one level of nesting, a variety
of components with at least two types of events, and at least one complex
element as described below.
You should design an original user interface. It can solve a problem
form business, such as allowing users to place product orders, a problem
from science such as displaying data, or an interesting game or graphical
representation. You can receive points for originality and creativity as
well as for the correctness and documentation of the code.
In addition to basic elements such as buttons, textfields, and so on,
you are required to have at least one "complex element". This could be
a particular component, or it could be the use of a set of components in
a complex way. Here are some examples to give you ideas of things that
you might include in your applet:
-
Using Lists to construct one of more user lists as described in this Font
Mover user interface . Perhaps you could use this idea in a business
user interface where the user could move items from the stock list to a
"shopping cart" and back.
-
A CardLayout
-
Using a variety of nontrivials element. Examples include having a control
panel for a graphics Canvas, such as in the "Sliders" applet, where Scrollbars
and a List control the appearance of the falling rectangle in the Canvas.
The "ShowData" example also falls into this category, except that its controls
are two simple for your homework - you could use a similar idea with more
controls over the graphing of the data.
-
A Frame with menus or Dialog box
-
A ScrollPane or PopUpMenu
-
GridBagLayout
-
Components from the Swing set. (Note that to use this you must compile
with JDK1.2beta.
You should include 1-2 of these ideas in your applet, depending on how
difficult they are. If in doubt, ask us about your design.
To submit your Java applet, include the description of the problem,
a link to the .html file (which will demonstrate the applet working), and
also a link to the .java file. As usual, the code should be nicely organized
and documented.