K
Kushal C
Guest
embedded in HTML ? I am enclosing the following code, which if compiled do not seem to be running as .class file from the command prompt with the Applet viewer. But on the contrary, if the applet is embedded in a HTML file, it runs smoothly with the applet viewer. Why doesn't it run as a .class file from the command prompt ? Any help would be highly appreciated, thanks in advance
import java.awt.*;
import java.applet.*;
public class Appl3 extends Applet
{
Label l1,l2;
TextField t1;
TextArea t2;
Button b1,b2;
public void init()
{
l1 = new Label("Enter Name :", Label.CENTER);
l2 = new Label("Enter Message :", Label.CENTER);
t1 = new TextField(10);
t2 = new TextArea(" ",5,10);
b1 = new Button("Submit");
b2 = new Button("Cancel");
add(l1);
add(t1);
add(l2);
add(t2);
add(b1); add(b2);
repaint ();
}
public void start()
{
repaint ();
}
public void stop()
{
repaint ();
}
public void destroy()
{
repaint ();
}
}
import java.awt.*;
import java.applet.*;
public class Appl3 extends Applet
{
Label l1,l2;
TextField t1;
TextArea t2;
Button b1,b2;
public void init()
{
l1 = new Label("Enter Name :", Label.CENTER);
l2 = new Label("Enter Message :", Label.CENTER);
t1 = new TextField(10);
t2 = new TextArea(" ",5,10);
b1 = new Button("Submit");
b2 = new Button("Cancel");
add(l1);
add(t1);
add(l2);
add(t2);
add(b1); add(b2);
repaint ();
}
public void start()
{
repaint ();
}
public void stop()
{
repaint ();
}
public void destroy()
{
repaint ();
}
}