import java.awt.event.*;
import java.awt.*;
import javax.swing.*;

/** 
 * The HangmanListener class.
 * 
 * This class attaches itself to the JButtons in the HangmanGUI window, and
 * reacts if the player clicks on any of the buttons, by communicating the 
 * mouse click to the underlying game class.
 */
public class HangmanListener extends MouseAdapter {
  
  /** The GUI display for the game. */
  private HangmanGUI gameWindow;
  
  /** 
   * THIS METHOD IS GIVEN. DO NOT CHANGE IT.
   * Set the game window that this object is listening
   * to. The window, gameWindow, will be updated whenever a mouse click
   * event occurs.
   * 
   * @param gameWindow  The window that displays the game. 
   */
  public void setGameWindow(HangmanGUI gameWindow) {
    this.gameWindow = gameWindow;
  }
  
  /** 
   * The mouseClicked event.
   * 
   * Reacts to the mouse being clicked on one of 
   * the buttons in the game window. Updates the
   * underlying layout. 
   * 
   * @param event The event that this object is listening for.
   */
  public void mouseClicked(MouseEvent event) {
    JButton button = (JButton) event.getComponent();
   
    // FILL THIS IN WITH YOUR OWN CODE
    
  }
}
