How to run Applet

Am getting the message "Applet Not Initialized" while running an applet program by appletviewer command but am getting the applet window.
[144 byte] By [meetandtalkraghu@yahoo.coma] at [2007-11-26 20:14:40]
# 1
Have you extended Applet class and did you override the init( ) method?
qUesT_foR_knOwLeDgea at 2007-7-9 23:21:02 > top of Java-index,Java Essentials,New To Java...
# 2

Even though I have extended the Applet class and Overridden the init() method am not getting the out put... Here is the program

//<Applet code=Applet2.java height=60 width=250> </applet>

import java.awt.*;

import java.applet.*;

import java.awt.event.*;

import java.util.*;

class Applet2 extends Applet implements ActionListener

{

Button b1;

TextField tf;

Label l1;

public void init()

{

b1=new Button("OK");

tf=new TextField(20);

l1=new Label("NOW");

add(l1);

add(tf);

add(b1);

b1.addActionListener(this);

}

public void actionPerformed(ActionEvent e)

{

Date d=new Date();

tf.setText(d.toString());

}

}

meetandtalkraghu@yahoo.coma at 2007-7-9 23:21:02 > top of Java-index,Java Essentials,New To Java...
# 3
//<Applet code=Applet2.class height=60 width=250> </applet>
qUesT_foR_knOwLeDgea at 2007-7-9 23:21:02 > top of Java-index,Java Essentials,New To Java...
# 4
Just now I tried ur solution ( //<Applet code=Applet2.class height=60 width=250> </applet> ) but am getting the same message :(
meetandtalkraghu@yahoo.coma at 2007-7-9 23:21:02 > top of Java-index,Java Essentials,New To Java...
# 5
> Just now I tried ur solution ( //<Applet> code=Applet2.class height=60 width=250> </applet> )> but am getting the same message :(What is the messge you are getting?
qUesT_foR_knOwLeDgea at 2007-7-9 23:21:02 > top of Java-index,Java Essentials,New To Java...
# 6
Start: applet not initialized
meetandtalkraghu@yahoo.coma at 2007-7-9 23:21:02 > top of Java-index,Java Essentials,New To Java...
# 7
Override the start() method from the Applet classMessage was edited by: qUesT_foR_knOwLeDge
qUesT_foR_knOwLeDgea at 2007-7-9 23:21:02 > top of Java-index,Java Essentials,New To Java...
# 8
Thank you for the solution but I dont know how to override start() method. Will u help me by editting the code given above?
meetandtalkraghu@yahoo.coma at 2007-7-9 23:21:02 > top of Java-index,Java Essentials,New To Java...
# 9

> Thank you for the solution but I dont know how to

> override start() method. Will u help me by editting

> the code given above?

Did you write the above code or you copied it from somewhere. Just like you have overridden init override start( )

Just add this to the aboce code after the closing brace of the init method

public void start( )

{

// blahblahblah

}

qUesT_foR_knOwLeDgea at 2007-7-9 23:21:02 > top of Java-index,Java Essentials,New To Java...
# 10
I wrote the whole code myself. I dint copy it from anywhere else. Now I just overriden the start() method given by u even am not getting the output...
meetandtalkraghu@yahoo.coma at 2007-7-9 23:21:02 > top of Java-index,Java Essentials,New To Java...
# 11
http://java.sun.com/docs/books/tutorial/uiswing/components/applet.html
DrLaszloJamfa at 2007-7-9 23:21:02 > top of Java-index,Java Essentials,New To Java...