Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

WhenI try to run this applet it gives an error??? why??need help!

 
Ammar Salem
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here is the code

It gives a run time Error that says:
java.lang.ClassCastException: ToolbarFrame cannot be cast to java.applet.Applet
at sun.applet.AppletPanel.createApplet(AppletPanel.java:760)
at sun.applet.AppletPanel.runLoader(AppletPanel.java:689)
at sun.applet.AppletPanel.run(AppletPanel.java:361)
at java.lang.Thread.run(Thread.java:620)

looking for help
Ammar Salem
[ January 17, 2008: Message edited by: Ammar Salem ]
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's simple: this code is not an applet. The base class of an applet needs to extend java.applet.Applet, not Frame. Do you want a separate window? If so, you can create and open this class from within the applet, but if not, you can rewrite it to extend applet (e.g. by getting rid of the WindowListener, amongst other things).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic