File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes appletviewer window never pop up Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "appletviewer window never pop up" Watch "appletviewer window never pop up" New topic

appletviewer window never pop up

Jenny raj
Ranch Hand

Joined: May 19, 2005
Posts: 57
import java.awt.*;
import java.applet.*;

public class HelloWorldApplet extends Applet {

// An applet that simply displays the string Hello World!

public void paint(Graphics g) {
g.drawString("Hello World!", 10, 30);

} // end of class HelloWorldApplet

This is the simple applet code that i try to ru

It compiles fine and also runs without any error but i don't see any applet window popping up

wat could be the reason

help me plz
Shaan Shar
Ranch Hand

Joined: Dec 27, 2005
Posts: 1249

How do you run it,
could you pls specify it..

A very silly mistake done by so many programmer is running Java Applet is like:::

java HelloWorldApplet

But this is not the way of running any applet..
Java provides a special Tool for running applet "appletviewer"..
what you have to do is
write a Sample.html file
Content of Sample.html file is:

and then place this file in the same directory as Class file....
and the at command line execute this command


I hope this will work and this time appletwindow will pop-up.....
and if still if you have any concern then revert me back.

Shaan Shar
Ranch Hand

Joined: Dec 27, 2005
Posts: 1249

Jenny raj ,

And if you have run the applet same as above thread then just put down the

error message or atleast snapshot to the forum

That will may bring some notice to us....

Justin Fox
Ranch Hand

Joined: Jan 24, 2006
Posts: 802
just extend JPanel, and then make a main class with a frame....

then see if it works, then upload with html...


You down with OOP? Yeah you know me!
Jenny raj
Ranch Hand

Joined: May 19, 2005
Posts: 57
Hey i am very sorry folks

it was a mistake on my part

i executed as appletviewer instead of appletviewer FirstApplet.htm

i made it correct and it is working

thanks dear ranchers
Ravindra Appikatla

Joined: Apr 27, 2006
Posts: 4
hey jenny no problem even u can run it as appletviewer
u need to include the <applet .....></applet> tag code in java code commented.
Jenny raj
Ranch Hand

Joined: May 19, 2005
Posts: 57
yeah it works

thing is i missed to include <applet></applet> tag in the java source code
I agree. Here's the link:
subject: appletviewer window never pop up
It's not a secret anymore!