Revision 15679 trunk/libraries/libUIComponent/src-test-ui/org/gvsig/gui/beans/table/TestTable.java

View differences:

TestTable.java
18 18
 */
19 19
package org.gvsig.gui.beans.table;
20 20

  
21
import javax.swing.JFrame;
22

  
21
import org.gvsig.gui.beans.TestUI;
23 22
import org.gvsig.gui.beans.table.exceptions.NotInitializeException;
24

  
25
public class TestTable extends JFrame {
23
/**
24
 * Test para la clase Table
25
 * @version 30/10/2007
26
 * @author BorSanZa - Borja S?nchez Zamorano (borja.sanchez@iver.es)
27
 */
28
public class TestTable extends TestUI {
26 29
	private static final long serialVersionUID = -1071011269441792511L;
27
	private TableContainer    table            = null;
30
	private TableContainer table = null;
28 31

  
29 32
	public TestTable() throws NotInitializeException {
30 33
		String[] columnNames = {"columna 1", "columna 2", "columna 3", "columna 4"};
......
32 35
		table = new TableContainer(columnNames, columnWidths);
33 36
		table.initialize();
34 37
		table.setControlVisible(true);
38
		table.setMoveRowsButtonsVisible(true);
35 39
		table.setEditable(true);
36 40

  
37
		String[] row = {"uno 0", "dos 0", "tres 0", "cuatro 0"};
38
		String[] row1 = {"uno 1", "dos 1", "tres 1", "cuatro 1"};
39
		String[] row2 = {"uno 2", "dos 2", "tres 2", "cuatro 2"};
40
		table.addRow(row);
41
		table.addRow(row1);
42
		table.addRow(row2);
43
		table.delRow(1);
41
		String row[] = {"", "", "", ""};
42
		for (int i = 0; i < 10; i++) {
43
			row[0] = String.valueOf(i);
44
			row[1] = String.valueOf(i);
45
			row[2] = String.valueOf(i);
46
			row[3] = String.valueOf(i);
47
			table.addRow(row);
48
		}
44 49

  
50
		table.swapRow(5, 6);
51
		table.delRow(3);
52

  
45 53
		getContentPane().add(table);
46
		setSize(400, 200);
54
		setSize(400, 300);
47 55
		setVisible(true);
48
		this.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
49 56
	}
50 57

  
51 58
	public static void main(String[] args) {

Also available in: Unified diff