To test the Fax application:
Download the Javacomm20-win32 JCA, which is available in a zip format at:
http://java.sun.com/products/javacomm/downloads/index.html
Unzip the zip file downloaded from the above URL.
Copy win32com.dll from the unzipped file to the jre\bin directory where J2SDK is installed.
Copy comm.jar from the unzipped file to the jre\lib\ext directory where J2SDK is installed.
Copy javax.comm.properties from the unzipped file to the jre\lib directory where J2SDK is installed.
Set the path of the bin directory of J2SDK by executing the following command at the command prompt:
set path=%path%;D:\j2sdk1.4.0_02\bin;
Set the classpath of the lib directory of J2SDK by executing the following command at the command prompt:
set classpath = %classpath%;d:\j2sdk1.4.0_02\lib; d:\j2sdk1.4.0_02\jre\lib\ext\comm.jar;
Copy the Java files for the Fax application to a folder on your computer. Use the cd command at the command prompt to move to that folder. Compile the files using the javac command, as follows:
javac *.java
Run the Fax application using the following command at the command prompt:
java PortFax
Select File->Open to open the document that you want to send as a fax using the Fax application. The selected file opens in the edit pane of the Fax Application window, as shown in Figure 6-4:
Figure 6-4: The Fax Application Window
Select the HTML check box if you want to send the fax document as an HTML page.
Specify the fax number in the Fax Number text box.
Select File->View Properties to set the properties of the port to which the modem is connected.
Click the Send Fax button to send the document as a fax document.
Click the Close button to close the Fax application.