import java.awt.Color;
import java.awt.Graphics;
import java.util.ArrayList;
import java.util.List;
import javax.swing.*;
import java.util.Random;

class main extends JPanel 
{
    public void paintComponent(Graphics G) 
    {
        Random rand = new Random();
        int x = 50;
        int y = 50;
        List<Color> couleur = new ArrayList<Color> ();
        for (int i = 0; i < 10; i++) 
        {
            couleur.add(i,new Color(rand.nextInt(255),rand.nextInt(255),rand.nextInt(255)));
        }

        for (int i = 0; i < couleur.size(); i++) {
            forme.parallelogramme(G, x, y, couleur.get(i));  
            x+=60;
        }
        
        //Polygon p = new Polygon();
        //g.fillPolygon(p);
    }
    public static void main( String args[] ) 
    {
        JFrame frame = new JFrame();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setBackground(Color.white);
        frame.setSize(750, 250);

        main panel = new main();

        frame.add(panel);
        frame.setVisible(true);      
    }
}