/[xulu]/trunk/src/appl/parallel/gui/SimplePropertyTable.java
ViewVC logotype

Annotation of /trunk/src/appl/parallel/gui/SimplePropertyTable.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 78 - (hide annotations)
Wed Feb 10 16:43:46 2010 UTC (14 years, 10 months ago) by alfonx
File size: 1016 byte(s)
Merged branch 1.8-gt2-2.6 to trunk. Now the trunk is based on GeoTools 2.6.1 and schmitzm-2.0.x
1 mojays 2 package appl.parallel.gui;
2    
3     import java.util.Enumeration;
4     import java.util.Properties;
5    
6     import javax.swing.JTable;
7     import javax.swing.table.DefaultTableModel;
8    
9     /**
10     * Just a simple 2 column Property Table
11     *
12     * @author Dominik Appl
13     */
14     public class SimplePropertyTable extends JTable {
15    
16     private final String colname1;
17    
18     private final String colname2;
19    
20     public SimplePropertyTable(String colname1, String colname2) {
21     super(1, 2);
22     this.colname1 = colname1;
23     this.colname2 = colname2;
24    
25     }
26    
27     public SimplePropertyTable() {
28     this("Property", "Value");
29     }
30    
31     public void setPropertyData(Properties propdata) {
32     Enumeration keys = propdata.keys();
33     // Create array
34     String[][] data = new String[propdata.size()][2];
35     int i = 0;
36     while (keys.hasMoreElements()) {
37     data[i][0] = (String) keys.nextElement();
38     data[i][1] = (String) propdata.getProperty(data[i][0]);
39     i++;
40     }
41     setModel(new DefaultTableModel(data,
42     new String[] { colname1, colname2 }));
43     }
44    
45     }

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26