public void startGame(List<Player> players, MenuPanel menu){
		this.allGameFrames = new HashMap<Player,GameFrame>();
		getContentPane().remove(menu);
		setVisible(false); 
		dispose(); 
		
		if(players == null || players.size() <2){
			throw new IllegalArgumentException("Invalid players number. Can't start the game.");
		}
		try {
			game = new Game(players);
			for(int i=0; i< players.size();i++){
				Player p = players.get(i);
				GameFrame frame = new GameFrame(p.getName(),game,this);
				frame.setLocation(i*200, 200);
				allGameFrames.put(p, frame);
			}
			//bring the first player's window to the front
			allGameFrames.get(players.get(0)).toFront();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}