Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Applett won't run

Posted on 2003-11-16
2
271 Views
Last Modified: 2010-03-31
hi @all,
i'm a bit ashamed asking tihs, but however.
i'm trying to learn java, and made a simple applett, or better, copied it from a tutorial.

HelloWorldApplet.java:

import java.applet.Applet;    
import java.awt.Graphics;
             
public class HelloWorldApplet extends Applet {

  public void paint(Graphics g) {
    g.drawString("Hello world!", 50, 25);
  }
 
}

test.htm:

<HTML>
<HEAD>
<TITLE> Hello World </TITLE>
</HEAD>

<BODY>
This is the applet:<P>
<APPLET codebase="classes" code="HelloWorldApplet.class" width=200 height=200 ></APPLET>
</BODY>
</HTML>


i can compile the .java file correctly.
the .class file is also placed in the same directory as the .htm file.
however, after clicking on the test.htm, the space reserved for the applet stayes gray=empty.
i'm using windows, with the java virtual machines installed correctly.
also, other applets, downloaded from the internet, will always work properly.
only mine, written and compiled by myself, don't do anything.

can somebody help me with that?
0
Comment
Question by:drnick
2 Comments
 
LVL 5

Accepted Solution

by:
lwinkenb earned 100 total points
ID: 9758037
place the .class file in a subdirectory called "classes"

Your codebase is indicating that the class files are in that subdirectory.
0
 
LVL 5

Author Comment

by:drnick
ID: 9758064
thanks, that was it
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

839 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