Please send questions to st10@humboldt.edu .

CIS 480 - Spring 2001
HW #2
Due: Wednesday, February 14, 2001, beginning of lab

Note that you need to write two distinct, different Java applications 
for this assignment.

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 application:
        *   with an AWT GUI (no Swing yet) --- it should at least
	properly set up and use a Frame or Frame subclass;
	*   that handles window-closing gracefully;
	*   with at least one sensitive component (that is, at least
	one component that deliberately "does" something when the
	user acts upon it);
	*   with a menu bar with at least two menus with at least
	two menu items each; note that each menu item needs to
	do *something*.
	*   that does something different from the in-class examples.

	*   name this application Hw2Num1.java

	*   some possibilities (mix and match as desired to meet the
	above requirements):
	        *   OK, you could use a Colors menu to customize
		colors in your GUI somewhat. But change the colors
		of something besides the frame background, and use
		different colors, at least... (could change font colors,
		for example...)

		*   For that matter, you could have a Fonts menu
		with several choices of fonts as menu item.

		*   Could have some textfields intended to hold
		numbers, and could then have a Math menu with
		different operations to be done to those numbers
		(with the results displayed in some fashion).

		*   A "clear" menu item within some menu could
		be used to clear all textfields or otherwise "reset"
		some aspect of the GUI.

2. Write a second, *different* Java application:
        *   uses command-line arguments;
	*   uses an AWT GUI (no Swing yet) --- it should at least
	properly set up and use a Frame or Frame subclass;
	*   that uses its command line arguments to affect, somehow,
	what appears on its GUI;
	*   that handles window-closing gracefully;
	*   that does something different from the in-class examples.

	*   name this application Hw2Num2.java

	*   some possibilities:
	        *   have the application put as many textfields
		on its frame as is indicated by the command-line 
		argument (you'd need to make sure that the command
		line argument was an integer within some small,
		reasonable range, of course, and would need to 
		complain if it was not);

		*   "customize" your frame (its labels and/or buttons, 
		etc.) with some string or strings given as command-line 
		arguments, and/or customize it color(s) based on 
		command-line arguments, etc. How should your application
		behave if no arguments are given? If inappropriate
		arguments are given (if inappropriate arguments are
		possible)? This one needs to do something different
		from your application for #1, note (although it
		could use one of #1's suggested ideas that you did
		not use on #1).

Minimal style standards (to be added to, if necessary!)
	*   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 two e-mails to st10@humboldt.edu as follows:
      *   each Subject: line should be the name of Java source
      contained within that e-mail message (so, one will have 
      Subject: Hw2Num1.java, and the other will have 
      Subject: Hw2Num2.java)

      *   the *body* of each e-mail should contain the
      Java source (that is, do NOT include it as an attachment!!!)

      *   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.)