import java.awt.Color;
import java.awt.Container;
import java.awt.FlowLayout;
import java.awt.Font;
import java.util.ArrayList;
import javax.swing.JFrame;


public class TestArrayOfDigitalClocks extends JFrame {
    
    public TestArrayOfDigitalClocks(String title) {
        super(title);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        //Container content = getContentPane();
        setLayout(new FlowLayout(FlowLayout.CENTER,1,1));
        ArrayList<DigitalClock> clocks = new ArrayList<DigitalClock>();
        Font clockFont = new Font("Courier",Font.BOLD,20);
        // construct the clocks and add to them to the JFrame
        for( int i = 0; i < 48; i++ ) {
            clocks.add(new DigitalClock(Color.red,Color.white,clockFont));
            add(clocks.get(i));
        } // end for
        // start the clocks
        for( int i = 0; i < clocks.size(); i++ ) {
            clocks.get(i).start();
        } // end for
    }
    
    
    public static void main(String[] args) {
        TestArrayOfDigitalClocks clocksFrame = new TestArrayOfDigitalClocks("Array of Digital Clocks");
        clocksFrame.setSize(800,700);
        clocksFrame.setVisible(true);
    } // end main
    
    
} // end TestArrayOfDigitalClocks

