Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I run an applet?

Status
Not open for further replies.

StanSteve

Instructor
Sep 22, 2001
16
US

Dear Java Friend,
In trying to run an applet... I downloaded the html converter and opened it from Windows Explorer. It asked
"Where would you like to install"?
I stored it in JBuilder4
It said "choose a java virtual machine"
I chose C:\jdk1.3.1\bin\java.exe

When I double click on the name TryingApplet.html to execute I get a window....it says at the top
"Apple Viewer TryingApplet.class"
at the botom of the screen it says
"start applet not initialized"
What to do?

Your advice is appreciated
Stan :)
dominskis@aol.com


 
you don't say whether or not you actually ran the converter over the html page. You did convert the html page didn't you?
 

Dear PipK,
I asked about doing an applet and you said " you don't say whether or not you actually ran the converter over the html page . You did convert the html page didn't you ? "
I must confess I don't know what you mean here at all. Java is very new to me. I do appreciate your assistance though.
Thanks :)
Stan
dominskis@aol.com














 
Dear Stan,

From what I've read in your email it appears you have both Borland JBuilder (Very ugly program to use I think, has too big of a learning curve when Java is hard enough.) But it looks like you have Sun's JDK1.3. IF you've written an applet, or downloaded the code for one, Jbuilder has a built in applet viewer as does JDK, but there shouldn't be any reason that you can't put a few lines of HTML code into a .txt file, save it as an .html file and open it in any of the latest browsers, they all should be able to interpret a Java Applet.

If this doesn't help you at all, this is Sun's Tutorial page on Applet writting, it has lots of information on your subject of interest.


Good Luck,

Rhoon
 
Ok, basically as you know an applet runs as part of an HTML page.
If your applet is written using anything greater than or equal to Java 2 (so 1.2.1 and upwards), or if it is written using Swing components (identified by being preceded by a J e.g. JApplet, JPanel, JButton etc) then the HTML page must be converted before it can run in most of the common browsers.

The conversion program you have downloaded from sun helps you do this, but it must be the correct version for the release of java that the Applet has been compiled by:

all you need to do is run the HTMLConverter class file in the same way you would run any other java class file (obviously making sure you have access to the java command by setting up your PATH variable in windows properly).

If you run it a panel will pop up prompting you for the path and name of the HTML file you wish to convert. It also gives you the option of backing the whole lot up into another specified path if you wish. It also needs you to specify the type of conversion needed (for me this is always standard for IE and Navigator on Windows and Solaris).

and then once this is done hit the convert button and the conversion should run. You will know it has been sucessful as the screen tells you the number of applets it detected during the conversion process (of course this should be at least one).

That is basically it, once this quick conversion has completed you should be able to open the html page in a browser and the applet will load.

Hope this helps.... ::)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top