/*
 * PokusDlg.java
 *
 * Created on 28. prosinec 2000, 16:16
 */

package timetable.gui;

import java.awt.Rectangle;
/**
 *
 * @author  Administrator
 * @version 
 */
public class PokusDlg extends javax.swing.JDialog {
    Rectangle rects [] = {
        new Rectangle(0,1,1,1),
        new Rectangle(2,2,2,3),
        new Rectangle(0,0,3,1),
        new Rectangle(4,0,1,1),
        new Rectangle(1,1,1,2)
    };

    /** Creates new form PokusDlg */
    public PokusDlg(java.awt.Frame parent,boolean modal) {
        super (parent, modal);
        initComponents ();
        pack ();
        this.jPanel.setPreferredSize(new java.awt.Dimension(200,200));
        this.jPanel.setSize(200,200);
        this.jPanel.setLayout(new TableLayout(5,5,2,2));
        for (int i=0;i<rects.length;i++) {
            javax.swing.JPanel panel = new javax.swing.JPanel();
            panel.setBorder(new javax.swing.border.BevelBorder(3));
            panel.setBackground(new java.awt.Color((int)(Math.random()*256),(int)(Math.random()*256),(int)(Math.random()*256)));
            panel.setPreferredSize(new java.awt.Dimension(rects[i].width*20,rects[i].height*20));
            if (i%2==0) panel.setVisible(false);
            jPanel.add(panel,rects[i]);
        }
//        jPanel.remove(((TableLayout)jPanel.getLayout()).getComponentAt(2,2));
    }

    /** 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 FormEditor.
     */
    private void initComponents() {//GEN-BEGIN:initComponents
        jPanel = new javax.swing.JPanel();
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                closeDialog(evt);
            }
        }
        );
        
        
        getContentPane().add(jPanel, java.awt.BorderLayout.CENTER);
        
    }//GEN-END:initComponents

    /** Closes the dialog */
    private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog
        setVisible (false);
        dispose ();
    }//GEN-LAST:event_closeDialog

    /**
    * @param args the command line arguments
    */
    public static void main (String args[]) {
        new PokusDlg (new javax.swing.JFrame (), true).show ();
    }


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel jPanel;
    // End of variables declaration//GEN-END:variables

}
