private Object spawnChoiceWindow(String title, String prompt, Object[] choices)
	{
		//This will create the dialogue window
		dialogSpawner = new JOptionPane(prompt, JOptionPane.QUESTION_MESSAGE,
				JOptionPane.DEFAULT_OPTION, null, choices, null);
		
		final JDialog dialog = dialogSpawner.createDialog(null, title);
		dialog.setModal(false);
		dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
		
		Thread t = new Thread() {
		     public void run () {
		         try {
					SwingUtilities.invokeAndWait(new Runnable() {
					        public void run () {
					        	dialog.setVisible(true);
					        }
			         });
				} catch (InvocationTargetException e) {
					e.printStackTrace();
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
		      }
		};
		t.start();		
		
		Object result = null;
		while(result == null || result.equals(JOptionPane.UNINITIALIZED_VALUE))
		{
			result = dialogSpawner.getValue();
		}
		
		dialog.dispose();
		
		return result;
	}