
                  GENERAL NOTES AND SOLVING COMMON ERRORS 


 How to solve some common errors installing Java applets.


 Java is supported only by Netscape 2+ and MS Explorer 3+ on 32 bit operating 
 systems (Windows 95/NT etc.), so you will not see Java applets if you are 
 running Windows 3.1, or a 16 bit browser; only the alternative message will
 appear.

 Java is different from JavaScript: Java is made by .class files and is more
 powerful than JavaScript (which is a script/batch language written directly
 inside a .html document). JavaScript is supported by Windows 3.1 as well.

 NOTE: If you decompressed this archive with DOS PKUNZIP, then the class and
 html file names will be corrupted, and nothing will work (you will see gray
 rectangles on htlm pages with a "ClassNotFound" error on status bar).
 In this case, you have to re-unzip the archive using Winzip 32 bit for Win95
 or similiar zip decompressor that handles long file names and subdirs.


                              --------------


All you have to do to install the applets is this:

1) Copy the .class files to the same dir as the .html files, along with any 
   GIF and JPG images. 

2) Add the <APPLET> tag in the html document, as explained in the
   instructions.
   Some html editors don't permit this or have special standards, in this
   case first save the .html file, then edit it with dos edit, notepad or
   another ASCII text editor, and then manually add the <APPLET> tag.

3) Upload the .html file, .class files and any others (images etc.) to your
   web page dir as usual. Please note that you have to upload the .class
   files using FTP in BINARY mode and not in ASCII mode !!
   Otherwise the applets will not work (a "ClassFormat" or "Method
   Verification" or "Bad Magic Number" error message will be displayed.


                              --------------

Common errors:

A) LONG FILENAMES TRUNCATION AND LETTER CASE CHANGE: Many MS-DOS users
   are still using PKUNZIP to decompress zip archives, and don't take into 
   consideration the difference between FiLe.ExE, FILE.EXE and fILe.eXe.
   This is not good for various reasons:

   The first one is the use of long file names: msdos (and old 16 bit
   win 3.1 programs) are only able to support files names with 8+3
   characters.
   Newer systems on the other hand support long file names, for example
   MyNiceApplet.class, which has got a suffix of 5 chars.
   If you use PKUNZIP to unzip the applet archives, or upload the .class
   files on the server with an old win 3.1 FTP program, etc., you will
   TRUNCATE the filename, and the result will be MYNICEAP.CLA !
   Then, a "ClassNotFound" error will be displayed.
   So remember to unzip using winzip 32 or similar in win95, and to
   copy/upload the files with new programs that doesn't truncate the
   filenames.

   Take into consideration the case of the characters as well since a lot of
   servers on the Internet (Unix) are case sensitive.
   So write MyNiceApplet.class and not Myniceapplet.class, for example.
   The most common mistakes are in image filenames because win95 is not case
   sensitive and it loads an image even if the case is different.
   For example, if you save an image as image1.jpg you will also be able
   to load it from your local harddrive if you refer to it as IMAGE1.JPG,
   image1.JPG or IMAGE1.jpg.
   But once you put it on your ISP's server it will only work if you refer
   to it as image1.jpg.
   So be sure that the names of images you load from an applet is exactly
   the same.

B) Wrong image or applet size: read the instructions for the applet carefully
   because sometimes images MUST be of fixed sizes (for example 64*64,
   128*128 etc.), and don't enlarge the applets too much, in any case never
   more than a width of 600 pixels, because a lot of people are using a
   video mode of 640*480 pixels.

                              --------------

Less common problems:

A) "Using Netscape Gold 3, the applets works offline, and not when online,
   displaying a "NullPointerException" or similiar error: this is a bug
   in the browser, that occasionally appears..."
   You must retry realoding, clearing cache, or in rare cases deleting the
   cache files manually from netscape cache directory.
   Similiar "NullPointer" error happens on Netscape 4.04 occasionally.
   But, don't worry, the visitors will have no problems seeing the applet.

B) "I updated all the class files on my GEOCITIES site, and when I reloaded
   the page I got an error (NoClassDefFoundException) in applets": this is
   a temporary problem generated by geocities upload only, if you reload
   the page after a couple of minutes applets will run correctly.

C) "I am using the AOL browser, and everything else on page would appear
    but where the applet was to appear there was a message -Loading image-,
    and the image never appeared, just a gray rectangle".
    In this case, you have to turn off graphics compression in the AOL
    internet browser preferences:
    On the AOL Toolbar, click Members, Click Preferences, Click WWW Icon
    (Picture of world globe), and you will see a dialog box.
    Click the Web Graphics tab, and a page appears with the question
    "Do you want Web Graphics to be compressed. This will display pages
    faster"; under the question is a box that you "check" if you want
    compression, otherwise leave it blank.
    If it is checked. clear it.

                              --------------

Some Tips & Tricks

   Probably you are thinking: What will people without Java browsers see
   instead of the applet ? You can specify an alternate text, image, or a
   whole html segment to be used instead of the applet:

<applet code="MyApplet.class" width=150 height=150>
<param name=param1 value="1234">
<param name=param2 value="5678">
<IMG ALT="*" ALIGN=center SRC="alternateimage.gif" border=0>
</applet>


   So, for example, you can display a normal image if Java is not present, 
   rather than Java manipulations of the image if Java is present.

   If you want to read .class files from another dir, just use the
   codebase tag:


<applet codebase="http://www.app.com/app/" code="MyApplet.class" width=150 height=150>
<param name=param1 value="1234">
<param name=param2 value="5678">
Sorry, your browser doesn't support Java.
</applet>


   You can even load images for applets from a cgi-bin/ dir, maybe a 'pic of
   the day' cgi or similar:

<applet code="MyApplet.class" width=150 height=150>
<param name=image value="/cgi-bin/Image.cgi">
<param name=param2 value="5678">
<IMG ALT="*" ALIGN=center SRC="/cgi-bin/Image.cgi" border=0>
</applet>

                              --------------

Bug reports:

- Don't save .JPG images from Adobe PhotoShop 4 (especially with thumbnail),
  because some Java implementations (Netscape 3) will not be able to read
  them. Use PhotoShop 3 or another program like Paint Shop Pro.

- MS Explorer 3.02 (and some beta 4.0 versions) have a bug that causes a
  SecurityErrorException when Java loads images from the local Hard Disk.
  Applets will work when you are online, but will be hard to test offline,
  so get a newer or older version (3.01 or 4.0 final for example).

  The URL for Java explorer upgrade is:

  http://www.microsoft.com/java/vm/vmdownload.htm


                              --------------

  FRONTPAGE USERS APPLETS CONFIGURATION STEPS:


 Here is, as example, the configuration steps for the Anfy Water applet:

 1) Unzip the Java Applet from anjavapp.zip

 2) Use Image Composer ( FrontPage's Tool ) to create a image, save it,
    for example, as "water.gif".

 3) In FrontPage Explorer, import the Java Applets, including anwater.html, 
    AnWater.class , Lware.class, waterscr.txt.

 4) In FrontPage Editor, open anwater.html, then, select the applet
    and click copy button on toolbar.

 5) Open new web page, click paste button on toolbar.

 6) Double click the applet, and you can open "Java Applet Properties" box.

 7) In Applet Parameters area, to find image item, click "Modify..." button.

 8) Modify width and heigth value accordingly to water.gif image size.

 9) click "OK".

 10) Modify waterscr.txt content to change scrolling text.

 If you are having directory problems on the server, this is because
 FrontPage requires a web server and forces you to import the .class
 libraries onto the web.
 If you copy them into the web directories, then you have to put them in
 the right place and select Recalculate Hyperlinks in the explorer.
 Then you have to make sure the applets parameter point to the applet
 properly.


                              --------------

  Compatibility problems:

  What to do if the JAVA APPLET(s) uses 100% of CPU power, slows down the
  browser, or steal all available memory ?

A) When the applet is running, Netscape or Explorer slows down, and sometimes
   the Operating System (Win95, WinNT, MacOS etc.) hangs or slows down as 
   well:

   In this case you have to increase the MinSYNC parameter until the 
   system operates normally. This value is usually set to 10, but you can 
   set it to 20,40,60,100 or even more to lower the applet speed and 
   thus leaving CPU power to the browser and OS. You can also decrease the 
   "priority" parameter.
   
   Here is an example of a more compatible setting:

        <param name=priority value="1">
        <param name=MinSYNC value="100">

B) When the applet have been running for some seconds or minutes memory
   runs out and the hard disk starts spinning (the OS is using it's swap 
   file to simulate more memory):

   In this case you are using a version of Netscape 3 / explorer 3 w/bugs,
   this problem is not present in the fixed rel. 3 and rel. 4, but you can
   fix the problem by decreasing memdelay to 10 - 16:

        <param name=memdelay value="15">

C) I want to be sure that the applet(s) will run on all the browsers, even
   old and buggy ones: this will decrease the speed of the applet a lot but
   I don't care; I prefer absolute compatibility:

        <param name=memdelay value="10">
        <param name=priority value="1">
        <param name=MinSYNC value="200">

   With these settings applets SHOULD work well on most browsers. Probably 
   you can still experience problems if you are running WinNT on a slow 486
   computer, in this case MinSYNC must be set to around 400 or more, but I
   hope there are not too many 33Mhz 486's running WinNT on the net.


                              --------------


   PLEASE DON'T INSERT MORE THAN ONE APPLET EACH WEB PAGE.

   But, if you really want to place more than one applet per page, be
   sure to set the priority parameter to 5 on all applets.
   Otherwise, if you want one to run faster and another to run slower,
   change their priority accordingly to your purposes.


                              --------------


                          SHAREWARE REGISTRATION


 If you really want to remove the linkware window (example: you are using
 applets in commercial sites or simply you can pay registration), you can
 REGISTER the applets paying to me US$ 20. This will encourage me to keep
 on developing new Java applets and enhancing the old ones.

 Each registration code only unlocks the applets on URLs on a specified 
 domain name, for example www.anfiteatro.it. With a US$ 30 registration 
 you receive the registration code for 2 URL names: you must provide the 
 URL names and you will receive the registration codes for these URLs 
 via e-mail. This can be useful if you divide the US$ 30 bill with a friend 
 that will use the other regcode. (In this case you will pay US$ 15 for a 
 regcode instead of US$ 20 this is the price for a single regcode).

 The registration code must be inserted in the "regcode" parameter, and it
 unlocks -ALL- the applets running from URLs on the registered domain name.
 The new applets that will be released in future, will work too as registered
 with the regcode you buy now, so come back and check for new applets!

 Note that the applets will run as registered from all the pages of the site.
 For example, if you register http://www.mysite.com , all the applets run
 from www.mysite.com/file.html and www.mysite.com/subdir/file.html will
 work as registered.
 This mean that the price for registering can be divided by all the people
 that resides under an unique root domain name.

 Registered applets doesn't display the linkware window, and have the reglink
 and regnewframe parameters enabled: with these parameters you can optionally
 specify a page where the applet will bring the user when clicked.
 The regnewframe parameter determine if the target is opened in a new window
 or on the same page as the applet, overwriting it.
 You can specify the name of a target frame too.

 Some applets also become more useful when registered, for example the CFade
 applet can become a banner, and also the CubeMenu applet.

 If you want another quantity than 2 registration codes, the following
 prices apply:

  reg. codes       price

     1             US$ 20
     2             US$ 30
     3             US$ 45
     4             US$ 60
     5             US$ 70
     6             US$ 80
     7             US$ 85
     8             US$ 90

 In most cases I don't allow one person to buy more than 8 regcodes.
 If you need more than 8 regcodes I will have to evaluate your case 
 individually (this is to prevent that people resell regcodes at lower
 prices).
 Buying 8 codes means you get 2 codes for free; I don't give larger discounts
 than 2 regcodes.

 For registration information and instructions please go to this page:

   http://www.anfiteatro.it/javadev/registration.html


                              --------------


 Copyright (c) Fabio Ciucci 1997/98

 fabioc@anfiteatro.it

 http://www.anfiteatro.it/java.html

