// file: Varmint.java
//

// import necessary java libraries
//
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.*;

public class Varmint {

    // declare global variables
    //
    private static JFrame  mainFrame = null;
    
    private static String user = null;

    // declare main program
    //
    public static void main(String[] args) {

	EnvProperties props = new EnvProperties();
	user = props.run("USER");

	// create the frame to display
	//
	mainFrame = new JFrame();
 
	// create a panel
	//
	VarmintPanel varmintPanel  = new VarmintPanel(user, false, mainFrame);
      
	mainFrame.getContentPane().add(varmintPanel);

	// listen for window closing events
	//
	mainFrame.addWindowListener(new WindowAdapter() {
		public void windowClosing(WindowEvent e) {System.exit(0);}
	    });
	
	// resize and set the frame dimensions
	//
	mainFrame.pack();

	// center the frame to the screen
	//
	Dimension screenDim = Toolkit.getDefaultToolkit().getScreenSize(); 
	Rectangle frameDim = mainFrame.getBounds(); 
	mainFrame.setLocation((screenDim.width - frameDim.width) / 2,
		    (screenDim.height - frameDim.height) / 2); 
	
	// display the frame
	//
	mainFrame.setVisible(true);
	mainFrame.addKeyListener(varmintPanel);

	
    }

} 

//
// end of file
