• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Start Applet not initialized

 
saurabh code sharma
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have created an applet and it is not working. When i try to run it in appletviewer it says Start Applet not initialized. Following is my code:

/*
<HTML>
<HEAD>
</HEAD>
<BODY>
<div >
<APPLET CODE="FormAction.class" WIDTH="800" HEIGHT="500">
</APPLET>
</div>
</BODY>
</HTML>
*/


import java.applet.*;
import java.awt.*;
import java.awt.event.*;

public class FormAction extends Applet implements ActionListener{
TextField text1;
TextField text2;
TextField text3;
Button button1;

public void init(){
setLayout(new FlowLayout());
button1 = new Button("Submit");
text1 = new TextField();
text2 = new TextField();
text2 = new TextField();

add(text1);
add(text2);
add(text3);
add(button1);

button1.addActionListener(this);
}

public void actionPerformed(ActionEvent evt){
if(evt.getSource() == button1){
text3.setText(text1.getText() + " " + text2.getText());
}
}
}

Can anyone please help me pointing out where am I wrong.
Thank You
 
Maneesh Godbole
Saloon Keeper
Posts: 11196
15
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.
Can you copy paste what you see on your java console after running the applet?

Also please check your private messages for an important administrative matter
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
text3 is null.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic