Skip to main content

Newbie - appletviewer problem (help I wanna get the boss away from VB6)

1 reply [Last post]
jaymeister
Offline
Joined: 2006-04-21

I can javac FrameDemo.java and its OK
====[FrameDemo.htm]=======================================

==========================================================
but when I appletviewer "FrameDemo.htm"

java.lang.ClassCastException
at sun.applet.AppletPanel.createApplet(AppletPanel.java:619)
at sun.applet.AppletPanel.runLoader(AppletPanel.java:548)
at sun.applet.AppletPanel.run(AppletPanel.java:299)
at java.lang.Thread.run(Thread.java:534)

heres the code - HELP!
====[FrameDemo.java]==============
import java.awt.Frame;

public class FrameDemo{
public static void main(String[] args) {
Frame f = new Frame("Ex. 9.1");
f.setSize(250,100);
f.setVisible(true);
}
}
=========================================================

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
bune
Offline
Joined: 2006-05-23

For an Applet you need to extend javax.swing.JApplet, and no main function is needed. Read the Applet tutorial on the sun homepage for further information.