POLITECHNIKA RZESZOWSKA - Wydział Elektrotechniki i Informatyki
ii *
public void actionPerformed(ActionEvent e counter++;
CloseJFrame cf = new CloseJFrame(); cf.setTitle("Window: " + counter); cf.setSize(200, 100);
cf.setLocation(200+30*counter, 100+30*counter) cf.setVisible(true) ; closeButton.addActionListener(cf);
}
public static void main(String[) args) {
MulticastEventDemo demo = new MulticastEventDemo(); demo.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); demo.setVisible(true);
}
class CloseJFrame extends JFrame implements ActionListener { public void actionJ?erformad(ActionEvent e) { setvisible(false);