@Override
			public void actionPerformed(ActionEvent e)
			{
				try
				{
					ballSize = Integer.parseInt(txtBallSize.getText());
					ballCount = Integer.parseInt(txtBallCount.getText());
					speed = Integer.parseInt(txtSpeed.getText());
					width = Integer.parseInt(txtWidth.getText());
					height = Integer.parseInt(txtHeight.getText());
					momentum = Double.parseDouble(txtMomentum.getText());
				}
				
				catch(NumberFormatException ex)
				{
					// Should implement this as a documentlistener in the future.
					JOptionPane.showMessageDialog(null, "Make sure all entries are numbers.");
					// awful form, to be replaced soon.
					return;
				}
				
				try
				{
					getOutsideReference().engineSettings = new EngineSettings.Builder().ballSize(ballSize).ballCount(ballCount).speed(speed).width(width).height(height).momentum(momentum).build();
				}
				
				catch(IllegalArgumentException ex)
				{
					JOptionPane.showMessageDialog(null, ex.getMessage());
					return;
				}
				
				dialog.setModal(false);
				dialog.dispose();
			}