Java Applet
What are Java and Java applets?
| Advanced Editors | Price |
|---|---|
| $39.95 | |
| $119.90 | |
| $49.95 |
This is our choice of advanced web editors.
They differ in functionality and price, and you must know your way around a bit to be able pick out the one that suits you the best. But then again, if you’re really an advanced user, you probably will.
Java is a programming language developed at Sun Microsystems in 1990. It was known and became popular on the WWW because Netscape Navigator 2.0 adopted and supported Java applets in 1996.
Applets are little programs written in Java language. They are designed to run inside a web browser and to perform some tasks such as animated graphics and interactive tools.
What do I need to have a Java applet work?
In order to use Java applets, you need to have associate files, which are complied applet programs usually ending with .class. One applet may need one or more .class files to make it work. You can check with the sources where you obtain the applets what .class files you need.
Adding an applet to an HTML file.
The start tag is <applet> and the ending tag is </applet>.
<applet codebase=xxx code=yyy width=123 height=123>
Where xxx=the name of directory your .class file stored; yyy=name of your .class file
Below is an excerpt from Instant Java Book. The real applets composition will looks like this:
<applet code=BasicText.class width=300 height=80>
<param name=TxFont value=TimesRoman>
<param name=Text value="BasicText">
<param name=TxPointSize value=36>
<param name=TxHorizCenter value=true>
<param name=TxVertCenter value=true>
</applet>
Note: Do you see <param> tag? It's the way that you can customize an applet by setting parameters within this tag.
Now, there are two ways to go from this step: writing your own applets or getting free applets on the WWW. If you seriously want to create an applet yourself, check the Java applets authoring tools listed on the next page. Some products boast that you don't need to know Java programming--just drag and drop and you will be done. Some tools are for programmers and allow you to write the raw code as you want. As a bonus, I have provided some examples of applets which you can copy and try in your own web pages. Good luck!
Java applets examples and Java sources
Below are some applets that are ready to use and links to Java sources on the web.
Digital Clock:
Does this digital clock look nice? You can get it at Thomsen's site. If you're new to Java applets, here are instructions.
- Go to Thomsen's site. (He is a guy who works for Netscape and allows you to use his applet)
- Save his page as an HTML document.
- Copy all the lines inside the tags
<applet>......</applet>to your home page. - Copy the file "Clock2.class" from that site and put it in the same directory of your HTML page in (3)
- The instructions for modifying this clock are already on his page.
Moving Text:
Instant Java site at vivids.com let you download many cool applets including the moving text above called "Ticker". You can also find this script and other useful applets in the book "Instant Java".
Gamelan contains links to Java applets Collection Sites.
If you more details about Java, you can get them at java.sun.com
If you have any cool links of Java applets, please tell us.