import java.awt.*; import java.awt.event.*; import java.util.*; public class PlaceButtons extends Frame { public PlaceButtons() { super("Placing Buttons"); setSize(400,200); setVisible(true); setLayout(new FlowLayout()); addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } }); } public static void main(String[] args) { Vector heap = new Vector(); PlaceButtons pb = new PlaceButtons(); for (String s : args) heap.add(new SortableButton(s)); // now add them all to the frame for (SortableButton b : heap) { pb.add(b); pb.validate(); try {Thread.sleep(1000);} catch (Exception e) {}; } } }