Java Applets

Ok..I've asked this before but I don't know where to start. I am brand new to Java applets. I need to know how to insert one in to FrontPage 2000 step by step. When you go to the Insert tool bar..then click on Java Applet a menu comes up. The menu asks for the following:  1. Applet Source  2. Applet base URL  3. Message for non-java browsers  4. Applet parameters Please explain from this starting point. I don't understand Java from the begining. I have a bunch of applets and I bought a book on it. But no one say where to start. Also...how can I test the Applet? Do I just peview it in my browser? Please HELP!
LVL 2
Paul RiskoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Paul RiskoAuthor Commented:
Edited text of question.
0
sgomsCommented:
Java can be used to create two types of programs: applets and stand-alone applications. An Applet is simply a part of a Web page, just as an image or a line of text can be. Just as a browser takes care of displaying an image referenced in an HTML document, a Java-enabled browser locates and runs an Applet . When your Java-capable Web browser loads the HTML document, the Java applet is also loaded and executed.

Lets take u thru to run a small applet.
Before you go on: If you don't own a Java development environment, you might want to download the Java Development Kit (JDK)(availabel at http://java.sun.com. The JDK provides a compiler you can use to compile all kinds of Java programs. It also provides an interpreter you can use to run Java applications. To run Java applets, you can use the JDK Applet Viewer or any Java-compatible Web browser.

Say you have a Java file called HelloWorld.java
If what you have is .class files go to step 2

1. Compile ur source file
>javac HelloWorld.java

2. You now have the class file HelloWorld.class
You can run ur applet thru a HTML document.

/** HelloWorld.html **/

<HTML>
<HEAD>
<TITLE> A Simple Program </TITLE>
</HEAD>
<BODY>

Here is the output of my program:
<APPLET CODE="HelloWorld.class" CODEBASE="/example" WIDTH=150 HEIGHT=25 ALT="HelloWorld applet!">
</APPLET>
</BODY>
</HTML>

open this file in the browser to view ur applet.

Lets come down to ur FrontPage problem.

1. Applet Source -- u have to specify teh .class file here. In the above HTML file we have given CODE="HelloWorld.class". That is what is asked here. You need to specify the .class file here.

2.Applet base URL -- If your applet exists in another server/directory other than the one where ur HTML file is there then you can specify the URL here.
CODEBASE="/example" specifies that my class file is present in teh dir HTML base + /example
You can even specify a seperate URL like http://www.xyz.com here.
If CODEBASE is left unspecified teh browser looks for the class file in the same directory.

3.Message for  non-java browsers  - will display the text under ALT as it wud for a <IMG ..>

4. Applet parameters -- U can pass parameters to ur applet using,
<PARAM NAME="Data" VALUE="123">
which can be obtained in teh java applet using the function getParameter("Data")

other than teh fst option 2,3,4 r optional to specify.

if u need further info please post ur comments.

-sgoms


0
Paul RiskoAuthor Commented:
Thanks..I've downloaded the java kit..and I've got questions on that but I won't be able to do any of this for a day or two. This is the answer I needed though. Starting Java is the hardest part...the language seems fairly easy to follow...from a beiginers point of view. Thanks again.
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

sgomsCommented:
Try java Tutorial available at http://java.sun.com
Its pretty good for beginners.
please post nay queries u might have though!

all the best & happy programming!
-sgoms
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Paul RiskoAuthor Commented:
Ok...I got the JDK installed. I am having a heck of a time with compileing a source file. I had Java in the dir under windows (throught MSdos for Win95) Now I don't know where it is (in dos..I can find it in windows)

I can't get C:\java at the dos promt...yeah I know..stupid question..but I'm stuck.

The Java tut. is very helpfull.

Thanks.
0
Paul RiskoAuthor Commented:
Is there an easyer way to start useing java? Kinda like FrontPage for HTML?
0
sgomsCommented:
Rgding JDK,

you must have installed JDK(1.1.x or 1.2 or 1.3 beta) under c:\jdkxxx\ directory. Thats the usual practice
Lets take ur jdk directory as java_home

then in ur autoexec.bat file make teh following entries,

SET PATH=java_home\BIN;
SET CLASSPATH=java_home\lib;

mostly it'll look like,
SET PATH=C:\JDK1.2\BIN;
SET CLASSPATH=C:\JDK1.2\lib;

You can then compile ur java files using,
>java xxx.java

If you are looking for a window's based Java IDE , there r a lot of stuff around. Microsoft VJ++, Visual Age from IBM, Borland's JBuilder, Symetic Cafe, Visual Cafe(they all have drag & drop facilities for u to create java applications/applets with ease)

but there might be some cross-platform problems 'cos they basically r designed for windows.

-sgoms
0
Paul RiskoAuthor Commented:
What other environment other than windows, would you want to use Java for? I just want kick but web pages.
 Thanks for all your help. I'm going to sign up for a class on Java. I'm sure I'll post at least one more comment.

 Paul
0
Paul RiskoAuthor Commented:
Have you ever used Visual Cafe? In your opinon...do u think it is better to learn Java or cheat and use something like Visual Cafe.

Thanks ...this is should be my last commment. I'm getting frustrated with the JDK. Final got somewhere with it though...awaiting your opinon

....you have helped a great deal.
0
sgomsCommented:
I personally use a very simple functionality editor calles SitePadPro. u can either go for these Visual cafe stuff or go for a editor which just gives u the functionality for cimpiling, running etc..

U can go in for Kawa(http://www.tek-tools.com). its one of the fst editors for java i guess.

just play around.
-sgoms
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.