Hi people i am just new to
Java programming especially to swing.I am just checking various things on java and running my programs on
Eclipse. I am checking few event handling stuff.I am getting error and my
applet is not being initialised due to this.
Please tell me what could be the error.Following is the program:
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public abstract class test extends JApplet implements ActionListener{
/**
*
*/
private static final long serialVersionUID = -2165717127504007034L;
public void init(){
JTextField jtf = new JTextField(15);
Container contentpane=getContentPane();
JButton jb=new JButton("France");
jb.setActionCommand("France");
jb.addActionListener(this);
contentpane.add(jb);
contentpane.add(jtf);
public void ActionPerformed(ActionEvent e) /* error shown here saying that Multiple markers at this line
- void is an invalid type for the variable ActionPerformed
- Syntax error on token ")", ; expected
- Syntax error on token "(", ; expected */
{
jtf.setText(e.getActionCommand());
}
}
}