Java Programming II 2015: Review 02 (Java GUI, Generics, Inner Class, Collections)
Submission Guide:
- Due Date: Before
the next week's exercise class (May 28, 2015).
- Create a directory ~/java2/ex-review2/ and give the "chmod 705
~/java2/ex-review2/" command, and save your answers to the directory.
[Package and Making Jar Exercise] Creating Jar files and Running it (20)
Read the lecture slides (#55, 56) carefully, and remind how to compile, create jar file, and run them.
Copy the "/home/course/java2/code/ByExercise/Week05-Review2/PackageExercise/*" to your working directory "~/java2/ex-review2/PackageExercise/" .
According to the guide of the slide (#55, 56), create jar files and run the packagetest.UsageDemoPackage class.
(Question)
Add one more class (ClassThree) to the demopackage, and modify the
UsageDemoPackage.java to invoke methodClassThree() in the main method.
And create jar files as before (you can choose names of the jar files as you want), and write a shell script
"runMymain.csh" for execution in your "~/java2/ex-review2/PackageExercise/" directory.
- Example of the "runMymain.csh" can be "java –classpath PackageClasses.jar:MainClass.jar packagetest.UsageDemoPackage"
[Simple Project] Creating A Simple Order System (80)
Copy the "/home/course/java2/code/ByExercise/Week05-Review2/review2/*" to your working directory.
Run the "java ProductOrder" to see running situation.
The final goal of your work is to create a complete code to show the same functions as that of the example binary code.
(The function includes "Putting into cart", "Show Cart", "Sort Items", and "Reset Cart".)
There is a sample code (ProductOrder-GUISample.java) for the GUI in the files that you copied just before.
It includes some guides you can follow or refer to for completion of your task.
The file name of your work is "ProductOrder.java".
The followings are running examples for "Show Cart" and "Sort Items".
* Details for your implementation:
- One product should be selected from the list.
- Sorting in the SortableDataStore is done based on the product name first and the number of items second
Figure: "Show Cart"

Figure: "Sort Items"
