The next command that we will discuss is the command used to put a java applet on your page. Java is an object oriented programing language developed by Sun Microsystems. Java allows, theoretically, any program that can be used on a normal computer to be used over the internet. But since programs for a computer are quite large and if they were going to run over the internet they would eventually have to be downloaded, and this has not been done in great scale. However, there are a wide variety of applets that do anything from text manipulation to help you write other applets on the internet. Most of the authors of these applets let you have the source code. This will allow you to put that same applet on your page and most likely personalize it to do want you want it to do without having to learn the Java language.
In order to put a java applet on your page you must first make one, or find one on the internet. After you have done this you must enter the commands needed to run the applet on your web page. If you find an applet on the internet the author will most likely have a documentation that comes with the applet telling you how to put it on your page. I will tell you how to put a basic applet on you page. The first command that you will need to enter is an angle bracket “<“ followed by the word APPLET followed by modifiers followed by an angle bracket “>”. The modifiers that appear in the APPLET command are normally CODEBASE followed by an equal sign “=”. This modifier tells the browser what directory all the .class’s are in. The next modifier is usually CODE followed by an equal sign “=”. This modifier tells the browser which is the main .class that should be executed for this applet. WIDTH or/and HEIGHT followed by an equal sign “=” sometimes are included. This width and height works exactly like the one in the IMG SRC command. Another modifier that you can choose to include is ALIGN followed by an equal sign “=”. This lets you ALIGN the applet in the center, to the right, or to the left. Next comes a list of parameters that will be inserted run with the .class. These parameters are dependent on what the Java applet does. Parameters are recognized by an angle bracket “<“ followed by the words PARAM NAME followed by an equal sign “=” followed by the name of the command followed by the word VALUE followed by an equal sign “=” followed by where that parameter is located and ended by an angle bracket “>”. These parameters will either be given to you in the instructions on how to install the applet on your page or, if you wrote the applet, you should know them. Then the applet is ended with an angle bracket “<“ followed by a slash “/” followed by the word APPLET followed by an angle bracket “>”. The final source code for using an applet that I found on the internet called LED sign would look like this:
But what if the person that is visiting your page does not have a browser that supports java? What will they see? Well if you leave the applet as shown they will see nothing but you can enter an alternative that the person will see. In order to do this, after you have decide what you want the person without java to see, you go to the document source and insert the HTML code of what you want the person to see after the last parameter and before the ending applet. This is very convenient if you want to put an ad for a browser that supports java and you don’t want the people with java to have to look at/download an ad for something that they already have. The final source code for the above applet with the alternative about downloading netscape would look like this: