import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
class log extends JFrame
{
JButton b1=new JButton("ok");
JPanel panel=new JPanel(new GridLayout(2,2));
public log()
{
panel.add(b1);
add(panel,BorderLayout.CENTER);
b1.addActionListener(new ActionListener(){
public void actionperformed(ActionEvent ae){
JPanel pan=new JPanel();
JFrame frame1 = new JFrame();
JButton b2=new JButton("ok");
pan.add(b2);
frame1.setVisible(true);
frame1.add(pan);
frame1.setSize(250,100);
b2.addActionListener(new ActionListener(){
public void actionperformed(ActionEvent ae){
JPanel pan1=new JPanel();
JFrame frame2 = new JFrame();
JButton b3=new JButton("ok");
pan1.add(b3);
frame2.setVisible(true);
frame2.add(pan1);
frame2.setSize(250,100);
}
});
}
});
}
public static void main(String args[])
{
log l=new log();
l.setSize(300,100);
l.setVisible(true);
}
}
i use eclipse iam getting 2 erors at
b1.addActionListener(new ActionListener()
b2.addActionListener(new ActionListener()