public static boolean addPartDialog() {
		JPanel addPart = new JPanel();
		JPanel input = new JPanel(new SpringLayout());
		JLabel nameLabel = new JLabel("Name*");
		JTextField name = new JTextField();
		JLabel quantLabel = new JLabel("Quantity");
		SpinnerNumberModel quantMod = new SpinnerNumberModel(1,0,10000,1);
		JSpinner quant = new JSpinner(quantMod);
		JLabel locationLabel = new JLabel("Location");
		JComboBox location = new JComboBox(Location.getLocationNames());
		JLabel descriptionLabel = new JLabel("Description");
		JTextField description = new JTextField();
		JLabel notesLabel = new JLabel("Notes");
		JTextField notes = new JTextField();
		input.add(nameLabel);
		input.add(name);
		input.add(quantLabel);
		input.add(quant);
		input.add(locationLabel);
		input.add(location);
		input.add(descriptionLabel);
		input.add(description);
		input.add(notesLabel);
		input.add(notes);
		name.setFocusable(true);
		name.requestFocusInWindow();
		
		location.setSelectedIndex(last);
		SpringUtilities.makeCompactGrid(input, 5, 2, 6, 6, 10, 10);

		boolean add = true;
		while(add) {
			//What the heck?
			int val = JOptionPane.showOptionDialog(null, input,"Add New Part",JOptionPane.OK_CANCEL_OPTION,JOptionPane.PLAIN_MESSAGE, null, new Object[] {"OK", "Cancel"}, name);
			System.out.println(val);
			if (val==2||val==-1)
				return false;
			if (name.getText().replace("~", "").equals("")) {
				JOptionPane.showMessageDialog(null, "Items must have a name.");
				continue;
			}
			add = false;
			Part p = new Part(name.getText().replace("~", ""));
			p.quantity = (Integer) quant.getValue();
			p.location = Location.values()[location.getSelectedIndex()];
			last = location.getSelectedIndex();
			p.description = description.getText().replace("~", "");
			p.notes = notes.getText().replace("~", "");
			Main.partList.add(p);
			Main.mainInstance.updateTable();
			Main.mainInstance.setTableScrollTo(Main.partList.indexOf(p));
			return true;
		}
		return false;
	}