java/rozsirene-atributy/src/cz/frantovo/rozsireneAtributy/gui/Panel.java
changeset 6 734f104f2869
child 10 ed2b6ebf138d
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/java/rozsirene-atributy/src/cz/frantovo/rozsireneAtributy/gui/Panel.java	Wed Dec 15 20:07:14 2010 +0100
     1.3 @@ -0,0 +1,57 @@
     1.4 +package cz.frantovo.rozsireneAtributy.gui;
     1.5 +
     1.6 +import javax.swing.table.TableModel;
     1.7 +
     1.8 +/**
     1.9 + *
    1.10 + * @author fiki
    1.11 + */
    1.12 +public class Panel extends javax.swing.JPanel {
    1.13 +
    1.14 +	private TableModel model;
    1.15 +
    1.16 +    public Panel(TableModel model) {
    1.17 +		this.model = model;
    1.18 +        initComponents();
    1.19 +		tabulka.setModel(model);
    1.20 +    }
    1.21 +
    1.22 +    @SuppressWarnings("unchecked")
    1.23 +    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    1.24 +    private void initComponents() {
    1.25 +
    1.26 +        scroll = new javax.swing.JScrollPane();
    1.27 +        tabulka = new javax.swing.JTable();
    1.28 +
    1.29 +        tabulka.setModel(new javax.swing.table.DefaultTableModel(
    1.30 +            new Object [][] {
    1.31 +                {null, null, null, null},
    1.32 +                {null, null, null, null},
    1.33 +                {null, null, null, null},
    1.34 +                {null, null, null, null}
    1.35 +            },
    1.36 +            new String [] {
    1.37 +                "Title 1", "Title 2", "Title 3", "Title 4"
    1.38 +            }
    1.39 +        ));
    1.40 +        scroll.setViewportView(tabulka);
    1.41 +
    1.42 +        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    1.43 +        this.setLayout(layout);
    1.44 +        layout.setHorizontalGroup(
    1.45 +            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    1.46 +            .addComponent(scroll, javax.swing.GroupLayout.DEFAULT_SIZE, 447, Short.MAX_VALUE)
    1.47 +        );
    1.48 +        layout.setVerticalGroup(
    1.49 +            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    1.50 +            .addComponent(scroll, javax.swing.GroupLayout.DEFAULT_SIZE, 316, Short.MAX_VALUE)
    1.51 +        );
    1.52 +    }// </editor-fold>//GEN-END:initComponents
    1.53 +
    1.54 +
    1.55 +    // Variables declaration - do not modify//GEN-BEGIN:variables
    1.56 +    private javax.swing.JScrollPane scroll;
    1.57 +    private javax.swing.JTable tabulka;
    1.58 +    // End of variables declaration//GEN-END:variables
    1.59 +
    1.60 +}