public MenuPanel(){
		players = new ArrayList<Player>();

		nameLabel = new JLabel("Name: ");
		nameField = new JTextField("",20);
		addButton = new JButton("Add Player");
		startButton = new JButton("Start Game");
		
		
		nameLabel.setLabelFor(nameField);
		
		updateAddButton();
		updateStartButton();
		
		nameField.getDocument().addDocumentListener(new DocumentListener() {
			
			@Override
			public void removeUpdate(DocumentEvent arg0) {
				update();
			}
			
			@Override
			public void insertUpdate(DocumentEvent arg0) {
				update();
			}
			
			@Override
			public void changedUpdate(DocumentEvent arg0) {
				update();
			}
			
			private void update(){
				updateAddButton();
				updateStartButton();
			}
		});
		
		addButton.addActionListener(new ActionListener(){

			@Override
			public void actionPerformed(ActionEvent arg0) {
				String name = nameField.getText();
				if(name == null || name.trim().length()==0 
						|| players.size() >= 4){
					return;
				}
				players.add(new StandardPlayer(name.trim()));
				nameField.setText("");
				updateAddButton();
				updateStartButton();
			}
			
		});
		
		
		startButton.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent e) {
				startGame();
			}
		});

		add(nameLabel);
		add(nameField);
		add(addButton);
		add(startButton);
		
	}