コード例 #1
0
  private void handleWin() {
    game.revealPuzzle();

    JOptionPane.showMessageDialog(
        null,
        "Congratulations, you win $" + game.getScore() + "!\n\n",
        "You Win!",
        JOptionPane.INFORMATION_MESSAGE);

    newGame();
  }
コード例 #2
0
  private void handleLoss(String message) {
    game.revealPuzzle();

    JOptionPane.showMessageDialog(
        null, message + "\nSorry, you lose.", "You Lose!", JOptionPane.INFORMATION_MESSAGE);

    newGame();
  }
コード例 #3
0
 private void setEnabledGuessedLetters(boolean b) {
   for (char c : game.getGuessedLetters()) {
     letterButtons[c - 65].setEnabled(b);
   }
 }