/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Okno.java
 *
 * Created on 2010-12-11, 13:18:02
 */
package choinka;

import java.awt.Color;
import java.awt.Graphics;
import java.util.Random;

/**
 *
 * @author romank
 */
public class Okno extends javax.swing.JPanel {

    @Override
    protected void paintComponent(Graphics g) {
        g.setColor(Color.blue);
        g.fillRect(0, 0, 400, 400);
        g.setColor(Color.black);
        g.drawString("Ida swieta", 200, 25);
        g.setColor(new Color(119, 73, 49));
        g.fillRect(180, 300, 30, 50);
        g.setColor(Color.green);
        int[] xPoints = {200, 350, 250, 380, 20, 150, 50, 200};
        int[] yPoints = {50, 190, 180, 300, 300, 180, 190, 50};
        g.fillPolygon(xPoints, yPoints, 8);
        g.setColor(Color.yellow);
        g.fillOval(50, 180, 20, 20);
        g.fillOval(330, 180, 20, 20);
        Random los=new Random();
        g.setColor(Color.white);
        for (int i=0; i<100; i++){
        g.drawString("*", los.nextInt(400), los.nextInt(400));
        }
    }

    /** Creates new form Okno */
    public Okno() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();

        jLabel1.setText("Choinka");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(18, 18, 18)
                .addComponent(jLabel1)
                .addContainerGap(344, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addContainerGap(275, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel1;
    // End of variables declaration//GEN-END:variables
}
