/*
 * Created on 2004/07/07
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package s1;

import java.awt.DisplayMode;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;

import javax.swing.JFrame;

/**
 * @author miya
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class FullScreenMain {

	public static void main(String[] args) {

		JFrame frame = new FirstFrame();
		
		DisplayMode mode = new DisplayMode(800, 600, 16,
				DisplayMode.REFRESH_RATE_UNKNOWN);
	
		GraphicsEnvironment environment = GraphicsEnvironment
				.getLocalGraphicsEnvironment();
		GraphicsDevice device = environment.getDefaultScreenDevice();
	
		frame.setUndecorated(true);
		frame.setResizable(false);
		device.setFullScreenWindow(frame);
	
		device.setDisplayMode(mode);
	
		frame.addKeyListener(new KeyAdapter(){
		    public void keyReleased(KeyEvent e) {
		    	System.exit(0);
		    }
		});
	}
}

