Solved

Applett won't run

Posted on 2003-11-16
2
288 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
[X]
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
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

623 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