Applet doesn't start in browser!
Hello!I got a small applet that will not start running when I try it in my browser.
I can run it with appletviewer but not with my IE 5.0.
This is the HTML-file:
<HTML>
<HEAD>
</HEAD>
<BODY>
<APPLET CODE="MyApplet5a.class" WIDTH="600" HEIGHT="400" CODEBASE=".">
<PARAM NAME=parameter1 VALUE="blue">
</APPLET>
</BODY>
</HTML>
In the same directory I have put the class file for this java file:
import java.applet.*;
import java.awt.*;
public class MyApplet5a extends Applet
{
Button myButton = new Button("The button");
Label myLabel = new Label("Hello world");
String statusText;
public MyApplet5a()
{
setSize(400, 400);
setBackground(Color.blue);
setLayout(null);
myButton.setLocation(100, 100);
myButton.setSize(100, 30);
myLabel.setLocation(100, 200);
myLabel.setSize(200, 30);
add(myButton);
add(myLabel);
//statusText = getParameter("parameter1");;
statusText = "Hello";
//showStatus(statusText);
}
public void init()
{
MyApplet5a myApplet5a = new MyApplet5a();
}
}
I have try to open the html-file with open and put it in a IIS and surf to it with localhost bla bla, but nothing happens.
The Javaconsol prints out this message:
Microsoft (R) VM for Java, 5.0 Release 5.0.0.3805
==============================================
? hjäp
c rensa
f kör slutförare
g samla in skräp
m minnesanvändning
q avsluta
t lista trådar
==============================================
Error loading class: MyApplet5a
java.lang.NoClassDefFoundError
java.lang.ClassNotFoundException: MyApplet5a
at com/ms/vm/loader/URLClassLoader.loadClass (URLClassLoader.java)
at com/ms/vm/loader/URLClassLoader.loadClass (URLClassLoader.java)
at com/ms/applet/AppletPanel.securedClassLoad (AppletPanel.java)
at com/ms/applet/AppletPanel.processSentEvent (AppletPanel.java)
at com/ms/applet/AppletPanel.processSentEvent (AppletPanel.java)
at com/ms/applet/AppletPanel.run (AppletPanel.java)
at java/lang/Thread.run (Thread.java)
Best regards
Fredrik
