import javax.swing.*;
import java.awt.*;

/**
A Centered JFrame
*/
public class ApplicationFrame extends JFrame
{
	/**
	@param xSize The width
	@param ySize The height
	*/
	public ApplicationFrame(String title, int xSize, int ySize)
	{
		super();

		setTitle(title);

		Toolkit toolkit = Toolkit.getDefaultToolkit();
		Dimension screensize = toolkit.getScreenSize();

		int screenXSize = (int)screensize.getWidth();
		int screenYSize = (int)screensize.getHeight();

		int x1 = (screenXSize-xSize)/2;
		int y1 = (screenYSize-ySize)/2;

		setBounds(x1,y1,xSize,ySize);
	}

	/**
	Changes the Look and Feel to Windows
	*/
	public void setWindowsLAF()
	{
		try
		{
			String plaf = "com.sun.java.swing.plaf.windows.WindowsLookAndFeel";
			UIManager.setLookAndFeel(plaf);
			SwingUtilities.updateComponentTreeUI(this);
		}
		catch(Exception e)
		{
		}
	}
}

