home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1997 October / PCO1097.ISO / FilesBBS / FREI / ANJAVAPP.EXE / notes.txt next >
Encoding:
Text File  |  1997-08-07  |  4.7 KB  |  127 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.  
  33.  
  34.                               --------------
  35.  
  36. Common errors:
  37.  
  38. A) LONG FILENAMES TRUNCATION AND LETTER CASE CHANGE: Many MS-DOS users
  39.    still use PKUNZIP to decompress zip archives, and haven't in mind the
  40.    difference between FiLe.ExE, FILE.EXE and fILe.eXe.
  41.    This is bad, for a couple of reasons.
  42.    The first is "long file names" usage: msdos (and old 16 bit win 3.1
  43.    programs) are able to support files 8 chars long with a suffix 3 chars
  44.    long. Newer systems are able to support long file names, for example
  45.    MyNiceApplet.class, that has a suffix of 4 chars.
  46.    If you unzip with pkunzip the applets archives, or upload the .class
  47.    files on the server with an old win 3.1 FTP program, etc., you will
  48.    TRUNCATE the filename, and the result will be MYNICEAP.CLA !
  49.    Then, remember to unzip with winzip 32 for win95 or similiar, and to
  50.    copy/upload files with new programs that don't truncate filenames.
  51.    Be careful on case of letters, too, since internet (unix) is case
  52.    sensitive. So, write MyNiceApplet.class and not Myniceapplet.class,
  53.    for example.
  54.    Most common mistakes are on images filenames, since win95 is not case
  55.    sensitive and it loads an image even if the case is different.
  56.    For example, save an image as Image1.jpg, and you will be able to load
  57.    it in netscape also if called as IMAGE1.JPG, image1.JPG, IMAGE1.jpg.
  58.    This will not work online, so be sure the name of images you load from
  59.    an applet is exactly the same.
  60.  
  61. B) Wrong image sizes or applet size: read carefully instructions of the
  62.    applets, since sometime images MUST be of fixed sizes (for example 64*64,
  63.    128*128 etc.) and don't enlarge too much applets, no more than 600 of
  64.    width (since many people has 640*480 video modes).
  65.  
  66.  
  67.                               --------------
  68.  
  69. Some Tips & Tricks
  70.  
  71. Probably you are thinking: what people without java browsers will see
  72. instead of the applets?
  73. You can place an alternate text, or image, or a whole html segment:
  74.  
  75.  
  76. <applet code="MyApplet.class" width=150 height=150>
  77. <param name=param1 value="1234">
  78. <param name=param2 value="5678">
  79. <IMG ALT="*" ALIGN=center SRC="alternateimage.gif" border=0>
  80. </applet>
  81.  
  82.  
  83. So, for example, you can display a normal image if java is not present,
  84. otherwise a java manipulation of the image.
  85.  
  86. If you want to read .class files from another dir, just use the codebase:
  87.  
  88.  
  89. <applet codebase="http://www.app.com/app/" code="MyApplet.class" width=150 height=150>
  90. <param name=param1 value="1234">
  91. <param name=param2 value="5678">
  92. Sorry, your browser doesn't suppor Java.
  93. </applet>
  94.  
  95.  
  96. You can even load images for applets from a cgi-bin/ , maybe for pic of
  97. the day or similiar:
  98.  
  99. <applet code="MyApplet.class" width=150 height=150>
  100. <param name=image value="/cgi-bin/Image.cgi">
  101. <param name=param2 value="5678">
  102. <IMG ALT="*" ALIGN=center SRC="/cgi-bin/Image.cgi" border=0>
  103. </applet>
  104.  
  105.                               --------------
  106.  
  107. Bug reports:
  108.  
  109. - Don't save .JPG images from Adobe Photoshop 4, since some java
  110.   implementations aren't able to read them. Use Photoshop 3, or another
  111.   program, like Paint Shop Pro.
  112.  
  113. - MS Explorer 3.02 has a bug, that cause a SecurityErrorException when java
  114.   loads images from local Hard Disk. Applets will work when online, but will
  115.   be hard to test them, so get a newer version or a previous one (3.01).
  116.  
  117.   The URL for java explorer upgrade is:
  118.  
  119.   http://www.microsoft.com/java/download/vmdownload.htm
  120.  
  121.                               --------------
  122.  
  123.  
  124.  Fabio Ciucci 1997
  125.  
  126.  http://www.anfiteatro.it/java.html
  127.