File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Applets and the fly likes Start:applet not initialized  Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Start:applet not initialized  Error" Watch "Start:applet not initialized  Error" New topic

Start:applet not initialized Error

Rakesh Chaudhary
Ranch Hand

Joined: Feb 19, 2008
Posts: 120
I experts I have problem displaying a button on a applet ....The following is the code I am getting a error i.e Start :Applet not initialized

/*<applet code="basic.Applet2.class" width=400 height=500>
</applet> */
//package basic;

import java.applet.Applet;
import java.awt.Button;
public class Applet2 extends Applet
Button b;
public void init()
b=new Button();

And the story is same for all other applet applications...Please help
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
If you comment out the "package basic" declaration, then you can't refer to the class as "basic.Applet2". Check the Java Console; it should show an error message to this effect.
Rakesh Chaudhary
Ranch Hand

Joined: Feb 19, 2008
Posts: 120
Thanks a lot Sheriff...I was so STUPID.......
Gauri Kudtarkar

Joined: Jan 04, 2011
Posts: 2
Can any one tell me how to run applet?
SeregaSuper Tramp

Joined: Nov 04, 2011
Posts: 1
Gauri Kudtarkar wrote:Can any one tell me how to run applet?

Hi,Gauri. You may simply start the command line and type, the following

this will create a java file where you place a code of your applet.Then you should complile it with java compiler in this way:

After complilation will be produced byte-code with .class extension. CHeck if it has worked out by cheking the directory:
>dir /p

Since every applet is being run in the browser, you should create also a html page, in context of which your applet will be run:
>notepad myPage.html

In the page write the following code(don't forget to save changes):

<applet code="MyApplet" width=600 height=500>Hello World</applet>


you can run this html page with a appletviewer in such way
>appletviewer myPage.html
gyan kumar
Ranch Hand

Joined: Sep 28, 2011
Posts: 61
In short first your java file should be compiled

after that use .class file in html file and see in IE/FF etc browsers.
gyan kumar
Ranch Hand

Joined: Sep 28, 2011
Posts: 61
for console based way you can check below url
I agree. Here's the link:
subject: Start:applet not initialized Error
jQuery in Action, 3rd edition