FileDocCategorySizeDatePackage
ArrayListTableSimple.javaAPI DocExample2388Sat Apr 28 10:22:38 BST 2001None

ArrayListTableSimple

public class ArrayListTableSimple extends JFrame
Simple demo of the com.darwinsys.util.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();

		addWindowListener(new WindowCloser(this, true));
	
Methods Summary
public static voidmain(java.lang.String[] args)

		new ArrayListTableSimple().setVisible(true);