Solved

Applett won't run

Posted on 2003-11-16
2
281 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
String array comparison 4 58
Java: The Public Class Main 4 66
passing enum to a method 4 52
Java array 10 89
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
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…
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 …
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 …
Suggested Courses

751 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