public DodgeWindow(int x,int y) {
		xIndex=x;
		yIndex=y;
		//setUndecorated(true);
		pack();			//getInsets() only works after you call pack() or show for some reason... Goddammit Java
		origX=(int)(MainClass.scale*MainClass.resolution/MainClass.yWindows*x+MainClass.edgePaddingX+((x!=0) ? MainClass.windowPaddingX/2 : 0));
		origY=(int)((MainClass.scale*MainClass.resolution+getInsets().top)/MainClass.yWindows*y+MainClass.edgePaddingY+((y!=0) ? MainClass.windowPaddingY/2 : 0)-getInsets().top);
		
		setSize((int)(MainClass.scale*MainClass.resolution/MainClass.yWindows-((x!=0 && x!=MainClass.xWindows-1) ? MainClass.windowPaddingX : MainClass.windowPaddingX/2)),
				(int)((MainClass.scale*MainClass.resolution+getInsets().top)/MainClass.yWindows-((y!=0 && y!=MainClass.yWindows-1) ? MainClass.windowPaddingY : MainClass.windowPaddingY/2)));
		setLocation(origX,origY);
		setResizable(false);
		
		setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
		addWindowListener(new WindowAdapter() {
			public void windowClosed(WindowEvent e) {
				if(!closedByGame)
					System.exit(0);
			}
		});
		setFocusable(false);

		this.addWindowFocusListener(new WindowFocusListener(){
			public void windowGainedFocus(WindowEvent e) {
				if(MainClass.topBarWindow!=null) {
					MainClass.topBarWindow.requestFocus();
				}
			}
			public void windowLostFocus(WindowEvent e) {}
		});
		setVisible(true);
	}