the complete webmaster
tutorials reviews reference
ASP
CGI
FrontPage
HTML
Java
JavaScript

home / articles / java

Java without programming!

In the last article we learned a little about what Java is. Now it's time to start using it. The bad news is that learning to program, even if you're a really smart person, isn't something you can do overnight, not even with an unlimited supply of caffeine. But due to the wonders of Java help is at hand. While I'm going to help you learn Java as this series of articles unfolds for now you can start using Java applets that others have built. For example if you really want to have the best web site known to intelligent beings you should

go to my web site and buy all of my shareware.

In fact you should buy multiple licenses of all of them. Just kidding! While I'd like to think my Java applets and applications are nice the truth of the matter is that by going to the world famous

Gamelan site

where there's so much Java you won't sleep for a month you'll be able to find just about everything you can think of. If you're looking for a simple applet to brighten up your page there are tons to choose from. You'll find nearly 900 special effects applets ranging from animations to text utilities. Heck there are 101 image map related applets. If you want an image map with a difference clearly this is the place to go. Many of these applets are free and the shareware ones won't break your budget, unless you're using the libraries computer as a ruse to stay in out of the cold, so you'll be able to enhance your site, and stay fashionably high tech, at a reasonable price.

If you want to see what other sites are doing with Java you can check out the nearly 800 sites listed that use Java. Or you might want to take a look at the 858 educational programs and applets. Of course Gamelan isn't the only site. I searched for +Java +resource and I found 1723 sites. My own bookmarks file has so many of them it's hard to keep track of what the best sites are. Many have only a few resources, like my Java pages, but others have lots. If you're in a hurry I'd start out at Gamelan and go elsewhere only if I didn't find what I wanted.

Bottom Line:

Odds are you'll find prebuilt Java applets that do what you want for little or no cost.

Before you ask I really don't have any idea which applets are good or bad. Gamelan picks the ones it thinks,actually the ones the reviewers think, are best and gives them the coveted "Cool" label. In general you should go to Gamelan with a Java capable browser and look at the applets you think might be interesting.


Ok now that you've decided that you really do want to add a garish scrolling message applet to your page what do you have to do. The simplest thing for me to say is that you should follow the instructions that come with the applet. But no unfortunately for me I'm too dedicated to do that. Instead I'll show you the basic approach, which as it turns out is really simple.

Applets are made up of one or more .class files which contain the compiled Java code. Depending upon what the applet does there may be other support files such as a images or sounds. You may run across applets that come in JAR or CAB format--both of these are special formats designed to combine several applet related files into one download. In that case follow the instructions that come with the applet or wait for a future article at this site. One of the .class files will be the main one and that will be specified by whomever gives you the applet.

All you need to do to add one or more Java applets to a page is to include the APPLET tag in your HTML page, one per applet--I'm not going to talk about how to run Java applications because that's very platform dependent. Many WYSIWYG HTML editors will auto build the tag for you. The basic syntax of the Applet tag is :


<APPLET CODE="classname.class" WIDTH=200 HEIGHT=400>

This message appears if the browser doesn't support Java

</APPLET>


This bit of HTML will cause an applet whose main file is called classname.class, which is in the same directory as the .html page, to run taking up a region 200 pixels wide and 400 pixels tall. The message in the middle, "This message appears if the browser doesn't support Java" does what it says it does. If you want to store the Java .class files elsewhere you can add the CODEBASE="directory where the .class file is stored" attribute.

Not all that hard is it?

NEXT: How to start developing your own Java projects

Author: tom trinko
Date: 10/02/97

More articles about java
More articles by tom trinko
Author Biography

write for us about us advertise

Copyright 1997, 1998 A Big Lime. All rights reserved.

> HTML>