Hi,
I have this Java code not running properly with showing the following error at command prompt on Linux os.
[root@localhost PracJava]# javac clicker.java
[root@localhost PracJava]# java clicker
Exception in thread "main" java.lang.NoSuchMethodError: main
Can any one help please? Thanks.....
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
public class clicker extends Applet implements ActionListener
{
TextField text1;
Button button1;
public void init()
{
text1 = new TextField(20);
add(text1);
button1 = new Button("Click here!");
add(button1);
button1.addActionListener(this);
}
public void actionPerformed(ActionEvent event)
{
String msg=new String ("Welcome to Java");
if(event.getSource()==button1)
{
text1.setText(msg);
}
}
}