ModernJava
http://www.modernminds.com
T roubleshooting Tips

This page contains some tips to help you if an applet or a class is not performing the way that you expect it to perform. If you are unable to solve the problem after reviewing these tips, please submit a bug report.
A pplets

The following are some tips to help you solve problems if an applet in a web page is not functioning properly.
Check the Class Files

Make sure that you have all of the needed class files available. The easiest way to do this is to copy all of the Java class files, the cab files, and the zip files that are located in the documentation's Java directory to the directory where you are keeping Java files.

For your convenience, below is a listing of the files that are required for each of the applets.

ImageURLButtonBar
    ButtonBar.class
    ButtonBarObserver.class
    ButtonRegion.class
    ButtonAnimate.class
    ImageURLButtonBar.class
    ButtonBarImg.cab (if using CABBASE)
    ButtonBarImg.zip (if using ARCHIVE)
TextURLButtonBar
    ButtonBar.class
    ButtonBarObserver.class
    ButtonRegion.class
    ButtonAnimate.class
    TextURLButtonBar.class
    ButtonBarTxt.cab (if using CABBASE)
    ButtonBarTxt.zip (if using ARCHIVE)
LiteTextURLButtonBar
    ButtonBar.class
    ButtonBarObserver.class
    ButtonRegion.class
    ButtonAnimate.class
    LiteTextURLButtonBar.class
    ButtonBarLTxt.cab (if using CABBASE)
    ButtonBarLTxt.zip (if using ARCHIVE)
Check the Parameters

The most common problems occur when parameter names or parameter values are specified incorrectly. For each PARAM tag , make sure that the spelling and capitalization of each NAME and VALUE is correct.
Use the Right Parameters

Sometimes more than one parameter must be specified in order to achieve a desired result. Make sure that you understand the effect that each parameter has and what (if any) additional parameters might be required. The documentation should have all the information you need.
Check the Status Bar

If a Modern Minds Java applet encounters an error, it will often attempt to display an error message in the browser's status bar (usually located at the bottom of the browser's window).

Sometimes the status message is shown in the status bar only briefly by the browser. In this case, try positioning the mouse over the applet as this will sometimes cause the status message to be re-displayed. (See also the output log tip below).
Check the Output Log

If an error occurs in a Modern Minds Java applet, the applet will usually log an error message to the console or to a log file. By reviewing the error message, you can often determine why the applet is not working (e.g., a missing or misspelled parameter).

Microsoft's Internet Explorer creates a log file (for Windows95, it is usually found as C:\WINDOWS\JAVA\javalog.txt), but only if the Java logging option is enabled. To enable Java logging, select Options from the View menu, then select the Advanced tab. Next, click the Enable Java Logging checkbox. After enabling Java Logging, you will need to shut down your browser and restart it.

If you are using Netscape Navigator, you can view error messages by selecting Show Java Console from the Options menu.

For other browsers, please consult your browser's documentation to determine how logging is performed.
Netscape Display Problems

Netscape Navigator seems to have a problem when a Java program draws a GIF image which uses a color pallet that does not match the Navigator standard pallet. In this case, Navigator dithers the colors in the image to match its standard pallet.

If the Java applet first performs some image processing on the GIF image, then the image is displayed correctly. However, if the unprocessed image is drawn, then it is dithered.

A way to get around this problem is to use a JPEG image in a case where an image is not to be processed before being drawn. The drawback to this approach is that JPEG images can be larger than GIF images (depending on a number of factors), and that JPEG images may not be as detailed as GIF images (depending on compression).

When creating your button bar, we suggest that you first try using whatever image file format is smaller, then replace a GIF with a JPEG if it does not look acceptable in Netscape Navigator.
Netscape JPEG Problems

If you are using Netscape Navigator 3.x, then in some instances you might find that a button bar that uses a JPEG image might not run when loaded from a web server over the network. The following describes how to fix the JPEG so that the applet will work.

The first thing to verify is that the JPEG's file name and location is correctly entered.

Next, take a look at the Java output log. The Java output log will often provide you with information that will tell you the cause of the problem.

If the Java output log has a message that is similar to:

sun.awt.image.ImageFormatException: JPEG datastream contains no image

then the browser is having a problem understanding the internal format of your JPEG file.

This problem with reading JPEGs has only been reported when Netscape Navigator 3.01 is being used as the browser -- you should not encounter this problem with Microsoft Internet Explorer or with Netscape Communicator (i.e., Navigator 4.0).

If you have used Adobe Photoshop 4.0 to create your JPEG image, you will need to make a setup adjustment and then re-save the image. In Photoshop 4.0, select "Preferences" from the File menu, and then choose "Saving Files...". Select "Never Save" from the Image Previews pop-up menu, and then re-save your JPEG file. You won't see an image preview in Photoshop's open-file dialog, but the image should now work with Java applets.

If you did not use Photoshop 4.0 to create your JPEG or if you are still encountering a problem, then try re-saving the file, but keep the JPEG save options as basic as possible. Also, try using a lower "quality" setting -- sometimes saving a JPEG with a "high quality" setting will cause this problem.

Keep in mind that if you re-save a JPEG, you must shut-down the browser and re-launch it in order for the Java applet to load the new version of your image file.
C lasses

The following are some tips to help you solve problems if a class that you are using in your own Java applet or application is not functioning properly.
Check the Parameters

The most common problems occur when parameter names or parameter values are specified incorrectly.

For each parameter of type String, make sure that the spelling and capitalization of the variable data being passed to the class is correct.

Also, sometimes multiple parameters must have a specific combination of values in order to cause a particular behavior. Make sure that you understand the effect that each parameter has and what (if any) additional parameter values might be required. The documentation should have all the information you need.
Check the Output Log

If an error occurs in a Modern Minds Java class, the class will usually log an error message to the console or to a log file. By reviewing the error message, you can often determine why the class is not working (e.g., an incorrect parameter value was passed).

Microsoft's Internet Explorer creates a log file (for Windows95, it is usually found as C:\WINDOWS\JAVA\javalog.txt), but only if the Java logging option is enabled. To enable Java logging, select Options from the View menu, then select the Advanced tab. Next, click the Enable Java Logging checkbox. After enabling Java Logging, you will need to shut down your browser and restart it.

If you are using Netscape Navigator, you can view error messages by selecting Show Java Console from the Options menu.

For other browsers or environments, please consult your browser's or your JVM's documentation to determine how logging is performed.
Copyright © 1997 by Modern Minds, Inc.