import java.awt.Container; import javax.swing.JFrame; import javax.swing.UIManager; public class CounterTest extends JFrame { public CounterTest (BasicCounter counter) { super ("Counter"); /*try { UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel"); //UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel"); //UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); } catch (Exception e) { e.printStackTrace(); }*/ Container mainPanel = this.getContentPane(); CounterPanel counterPanel = new CounterPanel(counter); mainPanel.add(counterPanel); } public static void runCounterTest (BasicCounter counter) { JFrame frame = new CounterTest(counter); frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); frame.pack(); frame.setVisible(true); } public static void main(String[] args) { //BasicCounter counter = new BasicCounter(0); //BasicCounter counter = new LimitedCounter(0,3); //BasicCounter counter = new RollOverCounter(0,3); BasicCounter counter = new StoppingCounter(0,3); runCounterTest(counter); } }