CS 380
User Interface Design
Introduction to Java Power Tools
David B. Levine
Computer Science Department
St. Bonaventure University
Copyright, 2002
Objective
By the conclusion of this lab period, you will have:
- Learned about software frameworks by using the Java Power Tools system.
- Written a small program in "JPT".
Background
Java Power Tools is a complicated system. The people
who developed it have written various tutorials to help you with it. The main
tutorial is about 25 pages in word. Please refer to it during lab, but
do not print out all 25 pages on the printer.
What has gone before
- Copy the files SimpleAdder.java and jpt.jar to a folder on your local machine. (If the download for these files does not work, there is another copy of them in the CS380 folder on the CSNet server.) Build a CodeWarrior project that contains both of these. Set the target class to be SimpleAdder. Compile the program.
- Look carefully at the function add(). Then run the program with various improper inputs for X, Y, Z, and W. Write a short paragraph explaining the difference between "request" and "demand" and also discussing how and when "suggestions" are given.
Breaking New Ground
- Design and implement an ArithmeticTester program that will do the following:
- There will be two TextFieldViews that will let the user type in two operands for an arithmetic operation and another TextFieldView that will show the result of the selected arithmetic operation.
- There will be a OptionsView where user selects whether to perform integer arithmetic or floating point arithmetic.
- There will be five action buttons, each representing one of the five arithmetic operations (+, -, *, /, %). When the user selects one of these buttons, the desired arithmetic operation will be performed. If the operation is illegal (there is no % for doubles), the output TextFieldView will so indicate.
- There may be a Clear button that will clear all three TextFieldViews to blanks.
- When you are done, print a listing of ArithmeticTester.java. Then take the entire project, put it in a folder with your name and "JPT1" on it (e.g. LevineJPT1) and copy it to the CS380 subfolder of the ClassUploadFolder on the CSNet server.
To Hand In:
Turn in the printout from Step 4, and the discussion from Step 2, along with a cover page.
Due Date This lab is due Monday, April
15, by 4 p.m.
Assignment Type (see
Academic Practices and Policies Document):
Group Project With Limited Collaboration