import java.awt.*;
import java.awt.event.*;
import java.util.Random;
public class SevenNumber extends Frame implements ActionListener {
public void main(String args[])
{
int p=0;
Panel panel=new Panel();
TextArea ta = new TextArea();
Button btn=new Button("OK");
btn.addActionListener(this);
TextField tf=new TextField(5);
SevenNumber SN=new SevenNumber();
panel.add(new Label("how many times you want: "));
panel.add(tf);
SN.add(btn,BorderLayout.SOUTH);
SN.add(panel,BorderLayout.NORTH);
SN.add(ta,BorderLayout.CENTER);
for (int i=1; i< 8 ;i++)
{
Random rand= new Random();
p=rand.nextInt(48);
ta.append(" number "+i+" =" +p+"\n");
}
SN.setSize(300,300);
SN.setVisible(true);
}
}
public void actionPerformed(actionEvent e)
{
//incomplete Code
}
Error: C:\jpro\chap9\SevenNumber.java:36: class, interface, or enum expected
public void actionPerformed(actionEvent e)
^
1 error
i want to use Action listener to detect people press the button , however it keep coming error and dont let me add actionlistener , wht is my problem