root / trunk / libraries / libUIComponent / src-test / org / gvsig / gui / beans / table / TestTable.java @ 10885
History | View | Annotate | Download (1.29 KB)
1 |
package org.gvsig.gui.beans.table; |
---|---|
2 |
|
3 |
import javax.swing.JFrame; |
4 |
import javax.swing.UIManager; |
5 |
|
6 |
import org.gvsig.gui.beans.table.exceptions.NotInitializeException; |
7 |
|
8 |
public class TestTable extends JFrame { |
9 |
private static final long serialVersionUID = -1071011269441792511L; |
10 |
private TableContainer table = null; |
11 |
|
12 |
public TestTable() throws NotInitializeException{ |
13 |
String[] columnNames = {"columna 1", "columna 2", "columna 3", "columna 4"}; |
14 |
int[] columnWidths = {70, 90, 110, 130}; |
15 |
table = new TableContainer(columnNames, columnWidths);
|
16 |
table.initialize(); |
17 |
table.setControlVisible(true);
|
18 |
table.setEditable(true);
|
19 |
|
20 |
String[] row = {"uno 0", "dos 0", "tres 0", "cuatro 0"}; |
21 |
String[] row1 = {"uno 1", "dos 1", "tres 1", "cuatro 1"}; |
22 |
String[] row2 = {"uno 2", "dos 2", "tres 2", "cuatro 2"}; |
23 |
table.addRow(row); |
24 |
table.addRow(row1); |
25 |
table.addRow(row2); |
26 |
table.delRow(1);
|
27 |
|
28 |
getContentPane().add(table); |
29 |
setSize(400, 200); |
30 |
setVisible(true);
|
31 |
} |
32 |
|
33 |
public static void main(String[] args) { |
34 |
try {
|
35 |
UIManager.setLookAndFeel("com.jgoodies.looks.plastic.PlasticXPLookAndFeel"); |
36 |
} catch( Exception e ) { |
37 |
System.err.println( "No se puede cambiar al LookAndFeel"); |
38 |
} |
39 |
try {
|
40 |
new TestTable();
|
41 |
} catch (NotInitializeException ex){
|
42 |
System.out.println("Tabla no inicializada"); |
43 |
} |
44 |
} |
45 |
} |