Webcam32 FAQs       User's Guide       Java Support       Help Wizard

Webcam32 and Java Applets

Webcam32 is an ideal application for use with Java Applets.  A Java applet is an application which is written in the Java programming language and is dynamically downloadable by a web browser such as Netscape Navigator or Microsoft Internet Explorer.


It is absolutely vital that you review the following documentation, especially the last paragraph.  Specifically ....

The JavaCam applet must be loaded from the same machine as the target image.  If you fail to do this, Java (not Webcam32 or even the JavaCam applet) will raise a Null Pointer security exception.  Java requires that any applet dynamically downloaded from the Internet only connect back to the machine from which it was loaded. 



JavaCam is a simple Java applet which obtains an image from Webcam32 either directly or from a saved FTP image.  JavaCam will also allow the image obtained from Webcam32 to be dynamically replaced with a new image after a configurable number of seconds have elapsed.  The Java approach to image refresh is superior to the Refresh meta tag approach as only the image will be refreshed and the rest of the web page will be left alone and not flicker. To use JavaCam, download the file and extract the JavaCam.class application.  Place this file in your HTML source directory on the Webserver.  In the HTML of your web page which displays the Webcam32 image, add the following HTML tags:

<APPLET code="JavaCam.class" width=320 height=240>
<PARAM name="url" value="">
<PARAM name="interval" value="30">

The width and height parameters should be set to the width and height of the image to be displayed.

The url parameter should be set to the URL of the image to be obtained.  If Webcam32 is being used in FTP mode, this will be the file on the Webserver where Webcam32 has placed the image.  If Webcam32 is being used as an HTTP server, this will be the location and port number of Webcam32 itself.

If the JavaCam.class file is upload to the Webserver via FTP, ensure that the FTP upload is switched to binary first.

It is vital that  that the url specified be a target to the SAME machine that JavaCam was loaded from itself.  If not, Java will raise a Null Pointer security exception.

The interval parameter specifies the number of seconds between image refreshes on the Web page displayed.

An additional parameter not shown is debug which may have the value on.  If set, this will cause the JavaCam applet to write debug information to the Java console.

Do not try an point the JavaCam applet's URL parameter at Webcam32's Server Push port.   Only a static image on the Web server which has been uploaded by Webcam32 or the single frame port should be used.

JavaCam security

The Java language architects a tight security model.  Specifically, for a downloaded Java applet, any communications that the applet may make (including communication with Webcam32 or with a Web server to obtain an image) must be to the machine from which the Java applet was originally loaded.  It is important that the "url" value for JavaCam point to the same Web server or machine running Webcam32 that the Java applet was loaded from.  Failure to do this will result in a security error when the applet is executed by the browser.

Additional usage notes:

Some common problems seen with using the JavaCam applet ...


<APPLET code="JavaCam.class" width=320 height=240>
<PARAM name="url" value="webcam32.jpg">
<PARAM name="interval" value="10">


<APPLET code="JavaCam.class" width=320 height=240>
<PARAM name="url" value="">
<PARAM name="interval" value="10">

The URL specified for the location of the Webcam32 uploaded image must include the server name not just the filename.


An alternative JavaCam applet called AnfyCam is also available.   AnfyCam is more sophisticated that JavaCam and provides additional features.   Information on AnfyCam and a free evaluation may be found here.