4.
POLITECHNIKA RZESZO WSKA - Wydział EtekBctocmfc . :rfem«y»:
I import j ava.awt.event.*;
1
public class ButtonEvent extends JFrame implements AotionLi starter ( ButtonEvent() (
i JButton("ChangeColor"); aner(this);
public Void actionPerformed(ActionEvent o) { if (panel.getBackground() == Color.red)
panel.setBackground(Colcr.green); else if (panel.getBackgroundO =*= Color.green) panel.setBackground(Color.blue);
else
panel.setBackground(Color.red);