import java.awt.*;
import javax.swing.*;
import java.sql.*;
import java.awt.event.*;



class VisuApp  extends JFrame implements ActionListener {
	
	
	private static Integer secs;
	
	public VisuApp(){
	
		super();
		this.getContentPane().setLayout(new BorderLayout());
		try {
			this.getContentPane().add(new VisuPanel(secs.intValue()), BorderLayout.CENTER);
		} catch ( SQLException e) 
			{ 
				e.printStackTrace();
			}
		
		
		JButton b1 = new JButton("Ok");
		b1.setActionCommand("quit");
		b1.addActionListener(this);
		this.getContentPane().add(b1,BorderLayout.SOUTH);
		
		this.addWindowListener(new WindowAdapter() {
			public void windowClosing(WindowEvent e) {
				                System.exit(0);
			}
		});
			
	
	
	
	}
	
	
	public static void main ( String[] args){
		
		
		if (args.length>0)
			secs = new Integer(args[0]);
		else
			secs = new Integer(3);
		
		JFrame frame = new VisuApp();
		
		frame.pack();
		frame.setVisible(true);
		
	}
	
	
	public void actionPerformed(ActionEvent e) {
		String command = e.getActionCommand();
		if (command == "quit") {
			System.exit(0);
		}
	}
		
	
	
	
}