to home page

BWRS
SEARCH

HOMETUTORIALSLINKSFORUMGLOSSARYNEWS
 

JAVA

JAVA

Java is widely used on and off the net as a programming language to add a range of functions

It was created by Sun Microsystems

It is a compiled language, which means that it must be translated (ie. Compiled) into machine code before use

However is the beauty of Java is that the code is converted into machine code for a virtual machine (your browser) not a specific computer or operating system

Its big advantage is that it will run on almost any system. Java programs can be huge or small and range from simple animation effects for the web to full blown office software

In terms of the web Java is coded in to programs called Applets, which can be triggered easily from the HTML page. Your browser will do all the hard work of setting up and running it (note most need a browser of the level of IE3 or Netscape 2 or higher to operate)

Below is a freeware link applet created by Anibal Wainstein of the Mandomartis Software Company. Run your pointer over it and click on a link if you like. (this may not work depending on browser security settings)

Java on the Web relies on programs called applets. These are stored in .class files

Most applets allow you to customize their function or parameters (e.g. change text or link targets)

Although applet writing is beyond this site. The actual HTML needed tontrigger and set up applets isn't difficult

The coding tags are easy to follow.

Let's use an example created by Sun Microsystems

Sorry you need a Java enabled browser to see this

The source. (Click for copyright and precise Java info)

The applet is coded for by these 3 lines

<applet code="NervousText.class" width=375 height=50>
<param name=text value="Leaping text !!!!">
Sorry you need a Java enabled browser to see this
</applet>


<applet> is the primary tag applets
the code attribute defines the applet (in this case NervousText.class)
Width and height attributes define the area in pixels taken up on the page

<param> tag allows you to customize the applet. In this example it allows you to set the text included in the applet. This defined by the name attribute (with value doing what it says i.e.. Setting the value of text in this case "Leaping Text!!!").
These can be multiple allowing a range of customization.

The "sorry..." line is added for non-Java enabled browsers to seeback to the top

Writing Java and applets is beyond this brief tutorial

However, there are tons of free applets on the net just like images. And it is a relatively simple programming language to learn. Check the links section for some ideas.

Remember to check the copyright of any you use. Many are downloadable but some your site links to and access (so you don't include the .class file on your site - your site links to a site acting as a server for the applet). Most have a way of giving the HTML directly to you so all you have to do is place it in your documents.

If you've not done so we'd recommend you now go on to read about Javascripts. This is another common online programming language, but unlike Java applets lines of programming (called scripts) are embeded directly into the pageback to the top

 

Back to advanced menu
Back To Advanced HTML