private void createPlayerPanel() {
		int nPlayers = (Integer)playerSelect.getSelectedItem();
		playerNames = new JTextField[nPlayers];
		JButton[] btnColors = new JButton[nPlayers];
		PlayerColors = new Color[nPlayers];
		JCheckBox[] PlayerAI = new JCheckBox[nPlayers];
		PlayerAIs = new boolean[nPlayers];
		Color[] recColors = {Color.blue, Color.red, Color.green, Color.yellow, Color.white, Color.cyan, Color.orange, Color.lightGray, Color.magenta, Color.pink};
		
		
		for(int i = 0; i < nPlayers; i++) {
			JPanel panel = new JPanel();
			PlayerColors[i] = recColors[i];
			PlayerAIs[i] = false;
			panel.setLayout(new GridLayout(2, 3));
			panel.setBorder(BorderFactory.createEmptyBorder(2,0,2,0));
			JLabel lblName = new JLabel("Player " + (i + 1) + "'s Name: ");
			playerNames[i] = new JTextField("Player " + (i + 1));
			JLabel lblColor = new JLabel("Player " + (i + 1) + "'s Color: ");
			btnColors[i] = new JButton();
			btnColors[i].setBackground(PlayerColors[i]);
			btnColors[i].setName("" + i);
			btnColors[i].addActionListener(new ActionListener() {
				@Override
				public void actionPerformed(ActionEvent arg0) {
					int playerNum = Integer.parseInt(((JButton)arg0.getSource()).getName());
					Color newColor = JColorChooser.showDialog(dialog, "Choose player " + playerNum + "'s color", PlayerColors[playerNum]);
					if(newColor != null) {
						PlayerColors[playerNum] = newColor;
						((JButton)arg0.getSource()).setBackground(newColor);
					}
				}
			});
			PlayerAI[i] = new JCheckBox("AI ", false);
			PlayerAI[i].setName("" + i);
			PlayerAI[i].addItemListener(new ItemListener() {
				@Override
				public void itemStateChanged(ItemEvent e) {
					int playerNum = Integer.parseInt(((JCheckBox)e.getSource()).getName());
					if(e.getStateChange() == ItemEvent.SELECTED) {
						PlayerAIs[playerNum] = true;
					} else if(e.getStateChange() == ItemEvent.DESELECTED) {
						PlayerAIs[playerNum] = false;
					}
				}
			});
			panel.add(lblName);
			panel.add(playerNames[i]);
			if(i > 0)
				panel.add(PlayerAI[i]);
			else
				panel.add(new JPanel());
			panel.add(lblColor);
			panel.add(btnColors[i]);
			playerPane.add(panel);
		}
	}