Discussion Locked

Simple applet won't run - please help

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi all,
I am an experienced programmer trying to learn Java. I have a very simple applet that I cannot get to run for some reason. Please see the code below:

import java.applet.*;
import java.awt.*;

public class BLinkJVerCheck extends Applet
{
private Label m_labVersionVendor;
public void init()
{
Color colFrameBackground = Color.pink;
this.setBackground(colFrameBackground);
m_labVersionVendor = new Label (" Java Version: " +
System.getProperty("java.version") +
" from "+System.getProperty("java.vendor"));
this.add(m_labVersionVendor);
}
}

As you can see, this a pretty simple, straight forward applet, but for some reason when I attempt to run it on a web page, I get the following error (when I put the mouse on top of the square the applet is supposed to draw):

load: class BLinkJVerCheck not found

The tag on the web page:

The applet file IS sitting in the same folder as the web page that calls it. When I compile the applet, everything goes ok, I get no errors and the class file is generated.

Any ideas....???... I always found Java annoying, and now that I finally want to make the move, I cannot get a stupid applet to work... please HELP!

Thank you in advance!

7 replies

by codecoaster

I am a student in Java and I dont have that much experience of applets but you could try this to see if it works.

Browser has Java Disabled

or

by abrarbhai

Hi,
There is an error in your tag:

Replace with:

Error:
if you put BLinkJVerCheck.class it takes it like

Class class in a package BLinkJVerCheck --> Which obviously is not the case here.

Also, the applet tag does not work like regular XML tags.

Regards,
Abrar

This discussion is closed to new replies.