• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Applet isn't starting.

 
Ranch Hand
Posts: 125
1
IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
  • 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: 7108
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
  • 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: 125
1
IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
  • 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: 7108
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Doesn't appletviewer need an HTML file?
 
Quazi Irfan
Ranch Hand
Posts: 125
1
IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
  • 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: 7108
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
  • 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
  • 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.
    Bookmark Topic Watch Topic
  • New Topic