public PreferencesDialog(UINew parent) {
		this.parent = parent;
		this.setTitle("Preferences");
		this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
		//this.setPreferredSize(new Dimension(250, 120));
		this.setResizable(false);
		this.setModalityType(Dialog.ModalityType.APPLICATION_MODAL);
		setupWindow();
		this.pack();
		this.setLocationRelativeTo(parent);
		
		try {
			File settings = new File(NineManMill.settingsfile);
			if (!settings.exists()) {
				//If settings file does not exist, make one
				settings.createNewFile();
			}
			//load settings file
			ini = new Wini(settings);
		} catch (InvalidFileFormatException e2) {
			// TODO Auto-generated catch block
			e2.printStackTrace();
			//maybe delete settings here
		} catch (IOException e2) {
			// TODO Auto-generated catch block
			e2.printStackTrace();
		}
		//add closing adapter - called when window dies
        this.addWindowListener(new WindowAdapter() {

            @Override
            public void windowClosing(WindowEvent e) {
            	try {
					ini.store();
				} catch (IOException e1) {
					// TODO Auto-generated catch block
					e1.printStackTrace();
				}
            }
        });
		
		this.setVisible(true);

		}