import javax.swing.*;
import java.awt.Graphics;
import java.awt.*;
import java.awt.event.*;

public class  buttonP0 extends JPanel implements ActionListener
{ 
  JButton b;
  JPanel inputPanel;
  
  public buttonP0()
  {    	
       setLayout(new BorderLayout());     
       inputPanel=new JPanel();
       b=new JButton("Push button to change background color");
       b.addActionListener(this);
       add(b,BorderLayout.NORTH);
       add(inputPanel,BorderLayout.CENTER); 
  }
  
  public void actionPerformed( ActionEvent e)
  {
  int red    =(int)(255.0*Math.random());
  int green  =(int)(255.0*Math.random());
  int blue   =(int)(255.0*Math.random());
  Color c=new Color(red,green, blue);
  inputPanel.setBackground(c);
  repaint();
  }

}
