Welcome to Geeklog, Anonymous Sunday, May 10 2026 @ 01:25 pm EDT
Geeklog Forums
Running a Java Applet from a Static Page
Status: offline
johnjr
Forum User
Chatty
Registered: 02/08/04
Posts: 68
I'm trying to run this Java Applet from a static page:
<p><applet name="morse" code="smorse.class" width="540" height="400"
align="bottom" vspace="1"> <param name="TEXT" value="cq "> <param
name="WPM" value="13"> </applet> </p>
The applet always fails to load.
I've placed the 'smorse.class' file in the main 'public' directory, as well as in the staticpages subdirectory, but to no avail.
Any suggestions on how to get this to work?
John
Text Formatted Code
<p><applet name="morse" code="smorse.class" width="540" height="400"
align="bottom" vspace="1"> <param name="TEXT" value="cq "> <param
name="WPM" value="13"> </applet> </p>
The applet always fails to load.
I've placed the 'smorse.class' file in the main 'public' directory, as well as in the staticpages subdirectory, but to no avail.
Any suggestions on how to get this to work?
John
17
19
Quote
Status: offline
jmucchiello
Forum User
Full Member
Registered: 08/29/05
Posts: 985
I've never tried this but you should probably give a complete path to the class in the code attribute. Also are you sure that's the name of the class? Most java classes have names like com.example.TheClass.
16
21
Quote
Status: offline
johnjr
Forum User
Chatty
Registered: 02/08/04
Posts: 68
Yes, that's the name of the class. The code works fine in an html file, with the class file in the same directory as the html file.
And I've tried setting the path, both as a URL and as a 'file path' on the server. It still doesn't work.
John
And I've tried setting the path, both as a URL and as a 'file path' on the server. It still doesn't work.
John
21
15
Quote
Status: offline
johnjr
Forum User
Chatty
Registered: 02/08/04
Posts: 68
I got it figured out. To load a Java applet from another location, the keyword 'Codebase' must be used, such as here:
align="bottom" vspace="1"> name="WPM" value="13">
The Java applet runs fine in a static page.
John
align="bottom" vspace="1"> name="WPM" value="13">
The Java applet runs fine in a static page.
John
16
17
Quote
All times are EDT. The time is now 01:25 pm.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content