Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Applett won't run

Posted on 2003-11-16
2
Medium Priority
?
293 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 400 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

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
In this post we will learn different types of Android Layout and some basics of an Android App.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
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…
Suggested Courses

722 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