Adding Java Applets

Java Applets

 

You will need to use some type of an applet maker to create an applet to add to Fusion. For example, Anfy  (www.anfy.com) offers a free applet maker that has about 40 different types of effects you can add to a web site. The example below is a snow applet. You use the applet wizard to set the parameters (information) for the applet, such as the size, the effect information, the image that will be the background for the effect, scrolling text, etc. The applet will then create an html file.  You have to highlight the applet code (it will begin with <applet....... and then end with </applet>, these brackets contain all the applet code between them), copy it, and then paste it into the page.  Upload all the class files to the server.  

 

Other types of applets can be purchased from Ulead (www.ulead.com or www.webutilities.com) , PageCharmerPro or PageCharmer,(www.mainstay.com)or many can be found for free on the internet.

 

More than one applet can run on a page but may slow the down the loading of the page. Each applet and it's class files must be uploaded to the server or the applet will not run. An applet is not the same as a javascript. Two or more javascripts may cause conflicts. Two scripts may not run together. An applet and a script will run on the same page.

 

Javascripts will be explained in the next chapter.

 

To add a  java applet, click the java button and draw in the area where the applet image will be placed.

A window will open and ask you to select the class files.  Go to the directory where the applet has been created, select the class file that runs the applet and then add any other files needed to make the applet run. There may be several types of class files in an applet.  For example, the Anfy applet, has an Anfy class, a snow class, etc. The snow applets main class file is the snow.class. The other files are added after the main class file is selected.

 

  Copy you java applet html file, click the HTML button in the Java Properties window, and choose the body tab and paste the applet code into this area.

First part of Applet - Note that an applet begins with <applet> - this opens the applet

the applet end or closes with </applet>

 

Here's another applet  code example:

 

 <applet codebase=classes code=GBanner width=500 height=85 name=gbanner>

<param name=BGColor value=#000000>

<param name=Rate value="50">

<param name=Pause value="2000">

<param name=Speed value="1000">

<param name=Image0 value="classes/images/nt1.jpg">

<param name=ImageAnimation0 value="NONE">

<param name=Image1 value="classes/images/nt2.jpg">

<param name=ImageAnimation1 value="SYNC_3_V_SLIDE_TOPBOTTOM">

<param name=Image2 value="classes/images/nt3.jpg">

<param name=ImageAnimation2 value="SYNC_3_V_SLIDE_BOTTOMTOP">

<param name=Image3 value="classes/images/nt4.jpg">

<param name=ImageAnimation3 value="SYNC_3_H_SLIDE_LEFTRIGHT">

<param name=Image4 value="classes/images/nt5.jpg">

<param name=ImageAnimation4 value="SYNC_Q_SLIDE_BOTTOMRIGHT">

<param name=Image5 value="classes/images/nt6.jpg">

<param name=ImageAnimation5 value="SYNC_3_V_BOTTOM_TOP">

</applet>

 

 

Some applet code corrupts in the page generation process.  Fusion components have no problem with the code, Ulead products do not seem to be affected, but other applets such as PageCharmer Pro or Anfy have to have their code fixed. You will find an open line of code above the applet code (open means that the > bracket that closes the applet is missing and the code is also a duplicate of the applets parameter information. This line of code needs to be removed. A second problem is that a double closing bracket > is placed at the end of the applet. Remove the second bracket. See examples.

The first line of code is corrupt

the  > following the </applet> is not necessary and should be deleted

 

Here's another example of the corrupt code with the bad code highlighted:  this is open code and the same information is in the  applets first line.  The highlighted code is not part of the code the applet created, Fusion added it.

 

 <APPLET ID="Java4" NAME="Java4" CODE="ansnow.class" CODEBASE="../../Web___Graphics_Design/Snow_Applet/" ARCHIVE="ansnow.jar" HEIGHT=436 WIDTH=500

 

 

                  <applet archive="ansnow.jar" code="ansnow.class" width="500" height="450">

<param name="credits" value="Applet by Fabio Ciucci (www.anfyteam.com)">

<param name="flakes1" value="600">

<param name="flakes2" value="400">

<param name="flakes3" value="200">

<param name="flakes4" value="0">

<param name="windmax" value="2">

<param name="windvariation" value="8">

<param name="speed" value="7">

<param name="backimage" value="ChristmasTree2.jpg">

<param name="bgcolor" value="004000">

<param name="overtext" value="NO">

<param name="overimg" value="achilly3.gif">

<param name="overimgX" value="350">

<param name="overimgY" value="225">

<param name="textscroll" value="snowscr.txt">

<param name="texttype" value="vertical">

<param name="textvspace" value="10">

<param name="textminfont" value="8">

<param name="textmaxfont" value="172">

<param name="textoffset" value="0">

<param name="textspeed" value="2">

<param name="textfont" value="TimesRoman">

<param name="textbold" value="YES">

<param name="textitalic" value="YES">

<param name="textsize" value="28">

<param name="textshadow" value="YES">

<param name="TextSColR" value="0">

<param name="TextSColG" value="0">

<param name="TextSColB" value="0">

<param name="TextColR" value="255">

<param name="TextColG" value="47">

<param name="TextColB" value="47">

<param name="TextJumpAmp" value="0">

<param name="TextJumpSpd" value="0">

<param name="TextSineAmp" value="0">

<param name="TextSineSpd" value="0">

<param name="TextSineAngle" value="0">

<param name="regcode" value="NO">

<param name="reglink" value="NO">

<param name="regnewframe" value="NO">

<param name="regframename" value="_blank">

<param name="statusmsg" value="Image created by Maureen">

<param name="memdelay" value="1000">

<param name="priority" value="3">

<param name="MinSYNC" value="10">

</applet>

                </APPLET>    This line is not necessary but does not cause any problems.

 

When the generated pages are uploaded to the server the class files must be uploaded as well. An applet will not show in the "preview" mode. It will only run after the page has been published and any corrupt code has been fixed. All files belonging to the applet must be with it on the server, including any images and text files.

 

 

Other components that are part of NetObjects Fusion can be added to the page by selecting the individual button.   The special components can be added by choosing the View drop down menu, Toolbars, Components, then NetObjects Fusion components.

 

  There are some very nice components offered in this toolbar: such as Ticker, Timed Image, Rotating Picture, Site Map, and more. See example.

 

To add one of the Fusion components click on the icon,(Ticker used here)  draw the ticker frame with the tool, set the parameters for the component, for example the ticker, choose the number of messages, the message, the background color, the border color (if you want a border around the ticker), the text color, etc.

This image shows the Ticker properties window, the ticker frame, and the NetObjects Fusion Component Toolbar. Choosing the Ticker (2nd from the right (abc), launched the ticker tool + (it looks like a larger version of the plus sign), you draw the size frame you want and then edit the properties.

 

Ticker Code:

 

<APPLET ID="TickerTape1" NAME="TickerTape1" CODE="TickerTape.class" CODEBASE="./" HEIGHT=56 WIDTH=550>

                    <PARAM NAME="text1" VALUE="Our next meeting is February 15th -  See Meeting Info Page for more details    ">

                    <PARAM NAME="speed" VALUE="25">

                    <PARAM NAME="framecolor" VALUE="yellow">

                    <PARAM NAME="backcolor" VALUE="black">

                    <PARAM NAME="ledtype" VALUE="0">

                    <PARAM NAME="ledcolor" VALUE="red">

                    <PARAM NAME="LEDsize" VALUE="2">

                </APPLET>

 

*Note that the first line of code is similar to the code that was corrupt in the Anfy Applet show above.  This code is not corrupt because Fusion has closed the (>) the end of the line. In the Anfy applet this code was corrupt and redundant.  Fusion generates its own applet code without any corruption in the code or adding the same information twice. Once you learn to recognize corrupt code, you can easily fix it.

 

 

NetObjects Fusion Tech Support or manual will tell you this is not the preferred method for adding applets. Their method is to copy each line of the applet, parameter by parameter and add it in. If you get one line wrong, the applet won't work!  I tried their way, added each line separately, went through their entire suggested process, and ended up with the same corrupt code. The way I show here  is the easiest and safest way to add the code.  It is really isn't a big problem once you remember to check the code if an applet doesn't run properly. It's an annoyance but not all things are perfect!

 

 

To view applets running visit the NJPCUG web site.  The headline running on the Home page is a Riada Headline, there is another Riada Headline running on the Events & Offers page, the Windows NT SIG has a PageCharmer Pro applet running on it's home page, so does the Senior SIG and the Graphics SIG.  Other applet examples can be found on the Graphics & Web Design SIG pages in the Gallery and on the design examples pages.