/** Method invoked at the beginning of the first game. Allows for players to select their names */ private void promptNames() { if (gui.getTeamName(WHITE).equals("") || gui.getTeamName(BLACK).equals("")) { String whiteName = ""; // ensure the name is not blank while (whiteName.equals("")) { whiteName = JOptionPane.showInputDialog("White team name:"); } String blackName = ""; while (blackName.equals("")) { blackName = JOptionPane.showInputDialog("Black team name:"); } gui.setTeamNames(whiteName, blackName); } gui.updateMessage(currentColor); }