FileDocCategorySizeDatePackage
ArrayListTableSimple.javaAPI DocExample2392Fri Jan 30 19:26:06 GMT 2004regress

ArrayListTableSimple

public class ArrayListTableSimple extends JFrame
Simple demo of the com.darwinsys.swingui.ArrayListTable{Model,Panel}. The "data" is an ArrayList made from the System Properties

Fields Summary
Constructors Summary
public ArrayListTableSimple()
Construct the main program's GUI

		super("ArrayListTableSimple");

		// Create empty ArrayList
		ArrayList data = new ArrayList();

		// Get the System Properties
		Properties p = System.getProperties();

		// Get an Iterator for the sorted set of keys in p
		Iterator it = new TreeMap(p).keySet().iterator();

		// Copy them into the ArrayList
		while (it.hasNext()) {
			String key = (String)it.next();
			String val = p.getProperty(key);
			data.add(new ArrayListTableDatum(key, val));
		}

		// Make the Model and View
		Model m = new Model(data);
		JPanel v = new ArrayListTablePanel(ArrayListTableDatum.class, data, m);

		// Make it show up in this JFrame
		setContentPane(new JScrollPane(v));
		pack();

		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	
Methods Summary
public static voidmain(java.lang.String[] args)

		new ArrayListTableSimple().setVisible(true);