Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!

saurabh code sharma

Greenhorn
+ Follow
since Jul 10, 2013
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by saurabh code sharma

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
7 years ago