Statistics
| Revision:

svn-gvsig-desktop / trunk / libraries / libUIComponent / src-test / org / gvsig / gui / beans / table / CheckBoxModelTable.java @ 10885

History | View | Annotate | Download (1.02 KB)

1
package org.gvsig.gui.beans.table;
2

    
3
import javax.swing.JFrame;
4

    
5
import org.gvsig.gui.beans.table.exceptions.NotInitializeException;
6

    
7
public class CheckBoxModelTable {
8
        private int                         w = 400, h = 200;
9
        private JFrame                         frame=new JFrame();
10
        private TableContainer        table = null;
11
        
12
        public CheckBoxModelTable() throws NotInitializeException{
13
                String[] columnNames = {"Cb", "columna"};
14
                int[] columnWidths = {22, 334};
15
                table = new TableContainer(columnNames, columnWidths);
16
                table.setModel("CheckBoxModel");
17
                table.initialize();
18
                
19
                Object[] row = {new Boolean(true), "texto 0"}; 
20
                Object[] row1 = {new Boolean(false), "texto 1"};
21
                Object[] row2 = {new Boolean(false), "texto 2"};
22
                table.addRow(row);
23
                table.addRow(row1);
24
                table.addRow(row2);
25
                table.delRow(1);
26
                
27
                frame.getContentPane().add(table);
28
                frame.setSize(w, h);
29
                frame.setVisible(true);
30
        }
31
        
32
        public static void main(String[] args) {
33
                try {
34
                        new CheckBoxModelTable();
35
                } catch (NotInitializeException ex) {
36
                        System.out.println("Tabla no inicializada");
37
                }
38
        }
39
}