?
Solved

Java Applets

Posted on 1999-12-09
10
Medium Priority
?
343 Views
Last Modified: 2013-11-23
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!
0
Comment
Question by:Paul Risko
  • 6
  • 4
10 Comments
 
LVL 2

Author Comment

by:Paul Risko
ID: 2270712
Edited text of question.
0
 
LVL 5

Expert Comment

by:sgoms
ID: 2271138
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
 
LVL 2

Author Comment

by:Paul Risko
ID: 2273711
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
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
LVL 5

Accepted Solution

by:
sgoms earned 600 total points
ID: 2274593
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
 
LVL 2

Author Comment

by:Paul Risko
ID: 2275777
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
 
LVL 2

Author Comment

by:Paul Risko
ID: 2275780
Is there an easyer way to start useing java? Kinda like FrontPage for HTML?
0
 
LVL 5

Expert Comment

by:sgoms
ID: 2276038
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
 
LVL 2

Author Comment

by:Paul Risko
ID: 2278351
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
 
LVL 2

Author Comment

by:Paul Risko
ID: 2278586
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
 
LVL 5

Expert Comment

by:sgoms
ID: 2278708
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

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses
Course of the Month3 days, 4 hours left to enroll

600 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question