import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
class multicast extends JFrame implements ActionListener
{
JButton b,b1;
int c=2,x=50;
multicast()
{
setLayout(new FlowLayout());
b=new JButton("click one time o/p multicast");
b.addActionListener(this);
add(b);
b1=new JButton("cancel");
b1.addActionListener(this);
add(b1);
}
public void actionPerformed(ActionEvent ae)
{
String str=ae.getActionCommand();
if(str=="click one time o/p multicast")
{
myframe f=new myframe();
f.setSize(300,300);
f.setLocation(20*c,20*c);
f.setVisible(true);
c=c+2;
}
if(str=="cancel")
{
System.exit(0);
}
}
public static void main(String args[])
{
multicast m=new multicast();
m.setSize(400,400);
m.setVisible(true);
}
}
No comments:
Post a Comment