Please send questions to
st10@humboldt.edu .
CIS 480 - Spring 2001
HW #4
Due: Monday, March 12, 2001, beginning of lecture
(note the expanding minimum style standards at the end of this homework
handout!!)
Note that you need to write from 1-6 distinct, different Java programs
for this assignment. (You MUST send AT LEAST 6 e-mails, with the
Subject: lines Hw4Num1.java, Hw4Num2.java, Hw4Num3.java, ...
Hw4Num6.java. However, you *may* end up writing as few as 1 program ---
maybe! See below.)
If you meet the minimum requirements below, that up to 90% credit. If
you do something interesting in these programs, that's how you can
get up to 100%. Note that the possibilities given below do count as
"interesting" in this sense.
1. Write a Java GUI application or applet that uses only Swing
components, and involves *properly* "painting on" it.
* (Yes, "painting on" is in quotes because, as you know,
with Swing painting is done differently, and not actually
on the JFrame or JApplet at all.)
* it should include at least one Swing component
sensitive to user action, that does does something
"painting"-related as a result of that action.
* it should have a relatively pleasing appearance;
* it should look different and do something different
from the in-class examples;
* name your application/applet Hw4Num1.java
* some possibilities:
* paint figure(s) other than rectangles;
fill them in in response to a button push.
Or, change their colors or shapes based on
a button push.
* paint text entered into a textfield
onto the applet or application. Include a
clear button to clear both the textfield
and the painted text on the applet or application.
* paint text in a font size entered in a
textfield. Let the font style be chosen from
a JMenu, and/or let the font be chosen from a JMenu,
and/or let the color of the painted text be chosen
from a JMenu.
2. Write a Java GUI application or applet that uses only Swing
components, and involves at least one JLabel or JButton with
an image on it.
* you MAY combine this with your program for one of
the other parts on this assignment, if you can do so in
an appropriate, pleasing way --- BUT, if you do,
you STILL need to send an e-mail with the Subject:
Hw4Num2.java, containing the *name* of the program that
you wish to also be graded for this part.
* if this part is not combined with another part, or
if it is the "earliest" of several combined parts, then
you should name your application/applet Hw4Num2.java.
* in the opening comment block, include the name(s)
of all gif files required by your program.
* make your gif files available to me in one of the
following ways:
* either include it in a web page using the
tag: <img src="YOUR_IMAGE.gif">
and include the URL to this web page IN your
opening comment block, OR
* e-mail the image(s) required, as attachments(!),
within an e-mail message with Subject: Hw4Num2 images
* this needs to use a different image from any used
in any in-class example, and needs to look significantly
different from any in-class examples.
* it should have a relatively pleasing appearance;
* some suggestions:
* you can get by with an image "pleasingly"
placed on a JButton or JLabel on this one, as long
as the general "look" of your program's layout is
noticeably different from the in-class example.
3. Write a Java GUI application or applet that uses only Swing
components, that somehow makes use of a JTable.
* you MAY combine this with your program for one of
the other parts on this assignment, if you can do so in
an appropriate, pleasing way --- BUT, if you do,
you STILL need to send an e-mail with the Subject:
Hw4Num3.java, containing the *name* of the program that
you wish to also be graded for this part.
* if this part is not combined with another part, or
if it is the "earliest" of several combined parts, then
you should name your application/applet Hw4Num3.java.
* this must be different from the in-class examples.
* amongst the table's columns must be at least two
containing significantly different data types.
* you must have at least 4 columns and 4 rows in your
table.
* it should have a relatively pleasing appearance;
* some suggestions:
* you can get by with a different table
"pleasingly" placed in this one, as long as
you meet the above requirements, and as long
as the general "look" of your program's layout
is at least somewhat different from the in-class
example.
4. Write a Java GUI application or applet that uses only Swing
components, that somehow includes "nice" use of a JTabbedPane.
* you MAY combine this with your program for one of
the other parts on this assignment, if you can do so in
an appropriate, pleasing way --- BUT, if you do,
you STILL need to send an e-mail with the Subject:
Hw4Num4.java, containing the *name* of the program that
you wish to also be graded for this part.
* if this part is not combined with another part, or
if it is the "earliest" of several combined parts, then
you should name your application/applet Hw4Num4.java.
* it should have a relatively pleasing appearance;
* it should include at least four tabs with appropriate
and descriptive tab text;
* the contents of the four panes should be significantly
different, and should be significantly different from the
in-class examples.
* some suggestions:
* one pane could contain a table, one pane could
contain a button or label containing an image,
one could contain a nice example of a Box, and
one could include several panels "outlined" by
borders.
* one pane could contain examples of colors,
one pane could contain examples of font styles,
one pane could contain examples of font sizes,
and one pane could contain examples of fonts.
5. Write a Java GUI application or applet that uses only Swing
components, that somehow includes "nice" use of at least one Box
component using BoxLayout.
* you MAY combine this with your program for one of
the other parts on this assignment, if you can do so in
an appropriate, pleasing way --- BUT, if you do,
you STILL need to send an e-mail with the Subject:
Hw4Num5.java, containing the *name* of the program that
you wish to also be graded for this part.
* if this part is not combined with another part, or
if it is the "earliest" of several combined parts, then
you should name your application/applet Hw4Num5.java.
* it must be significantly different from the in-class
examples;
* at least one of your Box instances should pleasingly
and appropriately use glue and/or struts;
* it should have a relatively pleasing appearance;
* some suggestions:
* use a Box to "nicely" place buttons in the
North or South of your applet/application ---
BUT, IF YOU DO THIS, you MUST make these buttons
*active* (sensitive to user input, with some
OBVIOUS action resulting from their push).
* use a Box to "nicely" place a column of
different textfields, perhaps requesting
a mailing address (one textfield for the name,
one textfield for the street address, one textfield
for the city and state, and one textfield for
the zip). Use other features to make it clear to
the user what they should be typing in.
6. Write a Java GUI application or applet that uses only Swing
components, that somehow includes "nice" use of borders.
* you MAY combine this with your program for one of
the other parts on this assignment, if you can do so in
an appropriate, pleasing way --- BUT, if you do,
you STILL need to send an e-mail with the Subject:
Hw4Num6.java, containing the *name* of the program that
you wish to also be graded for this part.
* if this part is not combined with another part, or
if it is the "earliest" of several combined parts, then
you should name your application/applet Hw4Num6.java.
* it must look significantly different from the
in-class examples.
* it should have a relatively pleasing appearance;
* some suggestions:
* borders seem especially effective when placed
around a sub-panel defining a certain area --- for
example, in a button-section in the bottom or top
of a frame or applet.
* they can give additional guidance to the user,
as well, if titled borders are used.
Minimal style standards (to be added to, if necessary!)
* [NEW] If you want to "paint" using Swing components,
use the guidelines as discussed in class and as demonstrated
in the in-class examples.
* [NEW] If your program involves gif files, either include
them as attachments in a separate e-mail file with
"Subject: [program name] images", OR include them on a web
page using the tag: <img src="YOUR_IMAGE.gif">
and include the URL for this page in your opening comment
block.
* The names of all required gifs, in either case,
must be included prominently and neatly in the opening
comment block, also.
* Java GUI applications must always include
System.exit(0), and must handle window closing gracefully;
* Run-time exceptions (such as, but not limited to,
NumberFormatExceptions) should be handled gracefully
by proper use of try-catch blocks.
* Any applet (AWT or Swing) must include in
its opening comment block its recommended size.
* every Java source file should begin with at least
a small block comment describing the purpose of what
is within, and including your name. If you are modifying
existing code (such as an in-class example), you should
indicate that, also.
* programs are expected to have at least a few
descriptive internal comments
* neat, consistent indenting is required.
* reasonably-descriptive and non-misleading variable
names are expected.
Then, send (at least) six e-mails to st10@humboldt.edu as follows:
* each Subject: line should be either:
* the name of Java source contained within that
e-mail message, OR
* the required name of the Java source that
would be contained there, if one program were not
being used for several parts, OR
* <required_java_source_name> images, if
it contains required image attachments.
* the *body* of the e-mail should contain either:
* the Java source (NOT included as an attachment!),
OR
* the name of the Java source to be graded
for this part, also; OR,
* the image file(s), as attachments.
* please FIX the indenting in the Java source code
if it is ugly when placed in the e-mail body! (Source code
pasted from BlueJ sometimes requires such clean-up.)