Inside Collection (Course): Object-Oriented Programming (OOP) with Java
Summary: Learn how to use the Guzdial-Ericson Multimedia Class Library
In the weeks and months to come, I will publish several modules that use a multimedia class library developed and made available by Mark Guzdial and Barbara Ericson of the Georgia Institute of Technology. The purpose of this module is to provide the information that you will need to obtain and use a copy of that library.
Among other things, the Guzdial-Ericson multimedia class library makes it practical to write object-oriented programs for the manipulation of images in an interesting and educational way. For example, the image in Image 1 was produced by manipulating and merging the images shown in Image 2 and Image 3 .
| Image 1: Result of merging two images. |
|---|
![]() |
One of the input images is shown in Image 2 .
| Image 2: Input image #1. |
|---|
![]() |
The other input image is shown in Image 3 .
| Image 3: Input image #2. |
|---|
![]() |
The Guzdial-Ericson library was originally published by Guzdial and Ericson in conjunction with their book Introduction to Computing and Programming with Java: A Multimedia Approach . While the book isn't free, the library is freely available and is published under a Creative Commons Attribution 3.0 United States License .
As of July, 2012, the latest version of the library can be downloaded in a zip file named bookClasses-3-9-10-with-doc.zip at http://home.cc.gatech.edu/TeaParty/47. Additional information is available at http://coweb.cc.gatech.edu/mediaComp-plan/101 .
Download the library
In order to work with the programs in the modules that use the library, you will need to download a copy of the latest version of the library from the site listed above. To guard against the possibility of that link becoming broken at some point in the future, I am depositing a backup copy of the zip file containing the library on the cnx.org site and you can download it here .
Prepare the library for use
Once you have downloaded the zip file, you will need to extract the folder named bookClasses from the zip file and store it somewhere on your computer's disk.
Library documentation
When you examine the contents of the bookClasses folder, you will see that in addition to source code and compiled class files for the library, the folder also contains javadoc documentation for the library in a folder named doc and some other material as well. Go to the doc folder and open the file named index.html in your browser to view the documentation.
Put the library on the classpath
You will need to put the path to the bookClasses folder on your classpath in order to incorporate classes from the library into your programs.
| Image 4: Putting the library on the classpath. |
|---|
|
For example, Image 4 shows three commands that you can execute at a Windows command prompt to
(The commands shown in Image 4 assume that the bookClasses folder is in the root directory on the M-drive. The bookClasses folder will likely be in a different location on your computer. They also assume that you are compiling and running a program having its main method in a class named Prob01 in a file named Prob01.java .)
Be sure to include the period and the semicolon shown before the M in Image 4 . This tells the Java compiler and the Java Virtual Machine to search first in the current folder before searching elsewhere on the disk for the required files.
You can also put the three commands in a batch file and run the batch file to avoid having to type the three commands each time you need to compile and run the program. In that case, you should add a pause command following the other three commands.
If you are using an IDE such as DrJava, JCreator, or JGrasp, see the instructions for the IDE to learn how to set the classpath in the IDE.
It is often useful to have the code for a simple program to test your system. This section presents two versions of the classical Hello World program. The first version is a simple text version that doesn't use Ericson's library. This version can be used to confirm that the Java Development Kit (JDK) is properly installed on your computer.
The second version is a graphic version that does require Ericson's library. This version can be used to confirm proper installation and use of the library.
The simple program shown in Listing 1 causes the words Text Hello World to be displayed on the standard output device when the program is compiled and executed.
| Listing 1: A text version of Hello World. |
|---|
|
As mentioned above, this program does not require the use of Ericson's library. It can be compiled and executed using a batch file containing the commands shown in Image 5 . You should make certain that you can compile and execute this program before progressing to the graphic version.
| Image 5: Batch file for text version of Hello World. |
|---|
|
Listing 2 contains the code for a graphic version of Hello World.
| Listing 2: A graphic version of Hello World. |
|---|
|
The program shown in Listing 2 causes the image shown in Image 6 to be displayed when the program is compiled and executed.
| Image 6: Hello World in graphics. |
|---|
![]() |
As mentioned above, this program does require the use of Ericson's library. It can be compiled and executed using a batch file containing the commands shown in Image 7 . You should make certain that you can compile and execute this program before progressing to more complex programs involving Ericson's library.
| Image 7: Batch file for graphic version of Hello World. . |
|---|
|
(Once again, the commands shown in Image 7 assume that the bookClasses folder is in the root directory on the M-drive. The bookClasses folder will likely be in a different location on your computer.)
This section contains a variety of miscellaneous information.
Financial : Although the Connexions site makes it possible for you to download a PDF file for this module at no charge, and also makes it possible for you to purchase a pre-printed version of the PDF file, you should be aware that some of the HTML elements in this module may not translate well into PDF.
I also want you to know that, I receive no financial compensation from the Connexions website even if you purchase the PDF version of the module.
In the past, unknown individuals have misappropriated copies of my modules from cnx.org, converted them to Kindle books, and placed them for sale on Amazon.com showing me as the author. I receive no compensation for those sales and don't know who does receive compensation. If you purchase such a book, please be aware that it is a bootleg copy of a module that is freely available on cnx.org.
Affiliation : I am a professor of Computer Information Technology at Austin Community College in Austin, TX.
-end-