@Override
	public void mouseMoved(MouseEvent e) {
		//checks position of cursor
		xPos = e.getXOnScreen();
		yPos = e.getYOnScreen();
		if(xPos!=centerX||yPos!=centerY)//if they are not center the jframe closes 
		{
		this.setVisible(false);
		this.dispose();
		}
	}