Download Instructions for Lab 2 - Java Beans

Download the lab2.zip file (Rename to lab2.jar after downloading)

INSTALL AND TEST INSTRUCTIONS FOR THE SIMSTICK JAVA BEAN

29 JUNE 1999

CSCI 397C-24 ADVANCED JAVA PROGRAMMING (SELF-PACED VIDEO COURSE)
LAB 2 JAVA BEANS

John Ichihashi
2129 Del Rosa Drive
Ridgcrest, CA 93555-7651
john_i@ridgecrest.ca.us
Business Phone: (760) 939-8301

INSTRUCTIONS FOR INSTALLING AND TESTING THE SIMSTICK JAVA BEANS LAB

1. Download the compressed lab2.zip file from my public ftp directory at address ftp.ridgenet.net/pub/users/j/john_i/Csci397C-24/Lab2. This is actually a jar file that has its extension changed to .zip to make it easier to download using Netscape Navigator. After downloading, change the name of the file from lab2.zip
back to lab2.jar.

2. Copy the the jar file to you local directory space and uncompress it using the command, jar -xvf lab2.jar. This will expand the subdirectories and files.

3. To view the project description and ADT documentation use your web browser to read the Lab2/Lab2-SimStick.html file in the directory folder you created.

4. To test the SimStick bean, copy or load the Lab2/Classes/simstick.jar file into the Java BeanBox Jars directory.  Now carry out the following steps:

A.  Make sure you have the JDK/JRE1.2.x available in your PATH and you CLASS variable is configured correctly and that your Java BeanBox works properly using the Sun demo beans. The SimStick bean was developed using JDK 1.2. in BDK 1.1. Note: Although the JDK1.2 was used to develop the bean code, this code did not utilize JDK1.2 specific classes and should run under JDK1.1.x.

B. Insert a single StickTester bean into the Bean box. Position it in the upper part of the Bean box and (optionally) modify its tableColor property. Also note the stick1 and stick2 values or change them to some different values. You will have to use these two different values in the two SimStick bean objects you will be adding next.

C.  Insert and position two of the SimStick bean objects into the Bean box.  You should set each object's stickID property to one of the two values you used for the stick1 and stick2 properties in the StickTester bean object. The SimStick bean properties for each object can be altered or left alone.
Attach each SimStick bean object's Events->simstick->stickmoved event to the StickTester bean object's "stickmoved" target method.

D. Add an ExplicitButton bean and change its label to "reset table". Attach its Events->button push->ActionPerformed event to the StickTester bean object's "resetTable" target method.

E. Now use the SimStick bean objects to move the green and white discs on the table.

F.  Save the BeanBox configuration and Load it to verify that the serialized objects are restored.

5.  A TestApplet. was made using the BeanBox. It is located in the Lab2/TestApplet directory. However, I have observed that it only seems to work using either the AppletViewer or the HotJava Browser application. The Netscape browser is unable to open the Java files correctly.

6.  If you have to recompile the source, change directory to the Lab2/Classes directory.
From here compile the classes by running the command:
$ javac simstick/*.java
Then build a jar file by running the command:
$ jar -cvfm simstick.jar simstick/*.mft simstick/*.class simstick/*.gif

7. The uncompressed files will have the following directory tree starting
with the directory you created to hold the jar file.

Your Folder
 |
 +--Lab2            contains Readme.txt and Lab2-SimStick.html
     |
     +--Classes
     |      |
     |     +--simstick   contains *.class, *.mft, *.java, and *.gif icon files
     |
     +--Docs      contains the ADT *.html files
     |
     +--Drawings  contains the object model gif file
     |
     +--Source    contains the *.java and *.gif icon files
     |
     +--TestApplet - contains a BeanBox generated test applet