• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Applet isn't starting.

 
Ranch Hand
Posts: 146
1
IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to run a simple Applet with the following code,

with the following command line :

But I am getting the following error,

and a Applet window pops up, and at the bottom of the window it says

I am following instructions from a book, and according to the book it should work, but it isn't.

What am I doing wrong?
 
Sheriff
Posts: 7125
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When you start the appletviewer, are you cd'd to a place where the viewer can find SimpleApplet.class? The easiest thing would be to be in the same directory.
 
Quazi Irfan
Ranch Hand
Posts: 146
1
IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Knute Snortum wrote:When you start the appletviewer, are you cd'd to a place where the viewer can find SimpleApplet.class? The easiest thing would be to be in the same directory.



Yes, I go to the folder where I have SimpleApplet.class. appletviewer program in on my ubuntu path. So I can essentially use the following appletviewer command to run the java file.

 
Knute Snortum
Sheriff
Posts: 7125
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Doesn't appletviewer need an HTML file?
 
Quazi Irfan
Ranch Hand
Posts: 146
1
IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Knute Snortum wrote:Doesn't appletviewer need an HTML file?



The alternate to using a separate html file is to add the html content in the source file.

And I have tried using a separate html file, but result is the same. I get the similar error.

 
Knute Snortum
Sheriff
Posts: 7125
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmm, I just tried it on my system and it works. Did you use javac to compile the source file?
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This applet is working fine on my machine. May be you are not saving this file with SimpleApplet name. So class not found exception is coming.
reply
    Bookmark Topic Watch Topic
  • New Topic