home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 April / CHIP_4_98.ISO / Java / applet / notes.txt < prev    next >
Encoding:
Text File  |  1998-02-02  |  9.2 KB  |  237 lines

  1.  
  2.                   GENERAL NOTES AND COMMON ERRORS SOLVING
  3.  
  4.  
  5. Here how to solve some common errors installing Java applets.
  6.  
  7.  
  8. You have to know that Java is supported by Netscape 2+, MS Explorer 3+ only
  9. on 32 bit operating systems (Windows 95/NT etc.), so you will not see java
  10. applets if running Windows 3.1, or a 16 bit browser: the alternate message
  11. will appear.
  12. Java is different from javascript: Java is made by .class files and is more
  13. powerful than javascript, that is a script/batch language written directly
  14. in .html document. Javascript is supported by Windows 3.1 (16 bit) too.
  15.  
  16.  
  17.                               --------------
  18.  
  19.  
  20. To install applets, you have simply to do this:
  21.  
  22. 1) Copy the .class files on same dir of .html files, same as GIF and JPG
  23.    images. 
  24.  
  25. 2) Add the <APPLET> tag in the html document, as explained in instructions.
  26.    Some html editors don't permit this or have strange standards, in this
  27.    case save the .html file, then edit it with dos edit, notepad or another
  28.    text editor, and add manually the <APPLET> tag.
  29.  
  30. 3) Upload .html file, .class files and other ones (images etc.) to your
  31.    web page account as usual.
  32.    Remember you have to upload with FTP with BINARY mode the .class files,
  33.    not in ASCII mode!! Otherwise applets will not work.
  34.  
  35.  
  36.                               --------------
  37.  
  38. Common errors:
  39.  
  40. A) LONG FILENAMES TRUNCATION AND LETTER CASE CHANGE: Many MS-DOS users
  41.    still use PKUNZIP to decompress zip archives, and haven't in mind the
  42.    difference between FiLe.ExE, FILE.EXE and fILe.eXe.
  43.    This is bad, for a couple of reasons.
  44.    The first is "long file names" usage: msdos (and old 16 bit win 3.1
  45.    programs) are able to support files 8 chars long with a suffix 3 chars
  46.    long. Newer systems are able to support long file names, for example
  47.    MyNiceApplet.class, that has a suffix of 4 chars.
  48.    If you unzip with pkunzip the applets archives, or upload the .class
  49.    files on the server with an old win 3.1 FTP program, etc., you will
  50.    TRUNCATE the filename, and the result will be MYNICEAP.CLA !
  51.    Then, remember to unzip with winzip 32 for win95 or similiar, and to
  52.    copy/upload files with new programs that don't truncate filenames.
  53.    Be careful on case of letters, too, since internet (unix) is case
  54.    sensitive. So, write MyNiceApplet.class and not Myniceapplet.class,
  55.    for example.
  56.    Most common mistakes are on images filenames, since win95 is not case
  57.    sensitive and it loads an image even if the case is different.
  58.    For example, save an image as Image1.jpg, and you will be able to load
  59.    it in netscape also if called as IMAGE1.JPG, image1.JPG, IMAGE1.jpg.
  60.    This will not work online, so be sure the name of images you load from
  61.    an applet is exactly the same.
  62.  
  63. B) Wrong image sizes or applet size: read carefully instructions of the
  64.    applets, since sometime images MUST be of fixed sizes (for example 64*64,
  65.    128*128 etc.) and don't enlarge too much applets, no more than 600 of
  66.    width (since many people has 640*480 video modes).
  67.  
  68.  
  69.                               --------------
  70.  
  71. Some Tips & Tricks
  72.  
  73. Probably you are thinking: what people without java browsers will see
  74. instead of the applets?
  75. You can place an alternate text, or image, or a whole html segment:
  76.  
  77.  
  78. <applet code="MyApplet.class" width=150 height=150>
  79. <param name=param1 value="1234">
  80. <param name=param2 value="5678">
  81. <IMG ALT="*" ALIGN=center SRC="alternateimage.gif" border=0>
  82. </applet>
  83.  
  84.  
  85. So, for example, you can display a normal image if java is not present,
  86. otherwise a java manipulation of the image.
  87.  
  88. If you want to read .class files from another dir, just use the codebase:
  89.  
  90.  
  91. <applet codebase="http://www.app.com/app/" code="MyApplet.class" width=150 height=150>
  92. <param name=param1 value="1234">
  93. <param name=param2 value="5678">
  94. Sorry, your browser doesn't suppor Java.
  95. </applet>
  96.  
  97.  
  98. You can even load images for applets from a cgi-bin/ , maybe for pic of
  99. the day or similiar:
  100.  
  101. <applet code="MyApplet.class" width=150 height=150>
  102. <param name=image value="/cgi-bin/Image.cgi">
  103. <param name=param2 value="5678">
  104. <IMG ALT="*" ALIGN=center SRC="/cgi-bin/Image.cgi" border=0>
  105. </applet>
  106.  
  107.                               --------------
  108.  
  109. Bug reports:
  110.  
  111. - Don't save .JPG images from Adobe Photoshop 4 (especially with thumbnail),
  112.   since some java implementations (Netscape 3) aren't able to read them.
  113.   Use Photoshop 3, or another program, like Paint Shop Pro.
  114.  
  115. - MS Explorer 3.02 (and some beta 4.0) have a bug, that cause a
  116.   SecurityErrorException when java loads images from local Hard Disk.
  117.   Applets will work when online, but will be hard to test offline, so get a
  118.   newer version or a previous one (3.01 or 4.0 final).
  119.  
  120.   The URL for java explorer upgrade is:
  121.  
  122.   http://www.microsoft.com/java/vm/vmdownload.htm
  123.  
  124.  
  125.                               --------------
  126.  
  127.  
  128.   What to do if the JAVA APPLET(s) uses 100% of CPU power, slows down the
  129.   browser, or steal all the ram memory:
  130.  
  131.   A) When the applet is running, Netscape (or Explorer) slows down too much,
  132.      and sometime even the Operating System (Win95, WinNT, MacOS etc.) hangs
  133.      or slows down?
  134.      Then you have to increase the MinSYNC parameter until the slow down
  135.      disappear. This is set usually to 10, but you can set it to 20,40,60,100
  136.      or more to decrease applet speed leaving CPU power to browser and OS.
  137.      You can also decrease the "priority" parameter.
  138.      Here an example of a more compatible setting:
  139.  
  140.         <param name=priority value="1">
  141.         <param name=MinSYNC value="100">
  142.  
  143.   B) When the applet is running, after some seconds or minutes the memory is
  144.      finishing and the hard disk starts swapping for virtual mem needs.
  145.      In this case you are using a bugged version of netscape 3 / explorer 3,
  146.      this problem is not present in fixed rel. 3 and rel. 4, but you can fix
  147.      the bug decreasing memdelay to 10 - 16:
  148.  
  149.         <param name=memdelay value="15">
  150.  
  151.   C) I want to be sure that the applet(s) will run on all the browsers, even
  152.      the old and bugged ones: this will decrease a lot the speed of the applet
  153.      but I don't care, I prefer absolute compatibility:
  154.  
  155.         <param name=memdelay value="10">
  156.         <param name=priority value="1">
  157.         <param name=MinSYNC value="200">
  158.  
  159.      With these settings applets SHOULD work well on all browsers.
  160.      Probably you can still find problems running WinNT on a slow 486
  161.      computer, in this case MinSYNC must be set to 400 or more, but I hope
  162.      there are no 33Mhz 486's running WinNT around the net.
  163.  
  164.  
  165.                               --------------
  166.  
  167.  
  168.      PLEASE DON'T INSERT MORE THAN ONE APPLET EACH WEB PAGE.
  169.  
  170.      But, if you really want to place more than one applet per page, be
  171.      sure to set priority parameter to 5 on all applets.
  172.      Otherwise, if you want one to run faster and another to run slower,
  173.      change their priority accordingly to your purposes.
  174.  
  175.  
  176.                               --------------
  177.  
  178.  
  179.                           SHAREWARE REGISTRATION
  180.  
  181.  
  182. If you really want to remove the linkware window (example: you are using
  183. applets in commercial sites or simply you can pay registration), you can
  184. REGISTER the applets paying to me US$ 30.
  185. This will encourage me keeping the development of new java applets and
  186. enhancing the old ones.
  187.  
  188. Each registration code unlocks the applet only on a specified domain URL name,
  189. for example www.anfiteatro.it. With US$ 30 registration you can receive the
  190. registration code for 2 URL names: you must provide the url names and you
  191. will receive the registration codes for these urls (via e-mail).
  192. This can be useful to divide US$ 30 bill with a friend that will use the other
  193. regcode you don't need. In this case you will pay US$ 15 for a regcode instead
  194. of US$ 20 (this is the price for one only regcode).
  195.  
  196. The registration code must be inserted in the "regcode" parameter, and it
  197. unlocks -ALL- the applets for registered URL domain name.
  198. Note that the applets will run as registered on all the pages of the site.
  199.  
  200. Registered applets doesn't display the linkware window, and have the reglink
  201. and regnewframe parameters enabled: with these you can optionally specify a
  202. page where the applet will bring when clicked.
  203. The regnewframe determine if the link is opened in a new window frame or on
  204. same page of the applet, overwriting it.
  205. Note: some applets become more useful when registered, for example the CFade
  206. applet can become a banner, same for CubeMenu applet.
  207.  
  208. If you want more or less than 2 regitration codes, here are the prices:
  209.  
  210.   reg. codes       price
  211.  
  212.      1             U$20
  213.      2             U$30
  214.      3             U$45
  215.      4             U$60
  216.      5             U$70
  217.      6             U$80
  218.      7             U$85
  219.      8             U$90
  220.  
  221. You can't but more than 8 regcodes, except particular cases I can evaluate,
  222. otherwise people will resell my codes at lower prices (you can buy 8 codes
  223. at the price of 6, but I don't allow more than 2 codes gifted).
  224.  
  225. For registration informations and instructions, go to this page:
  226.  
  227.    http://www.anfiteatro.it/javadev/registration.html
  228.  
  229.  
  230.                               --------------
  231.  
  232.  
  233.  Fabio Ciucci 1997/98
  234.  
  235.  http://www.anfiteatro.it/java.html
  236.  
  237.