Пример #1
0
  public MenuItem checkContains(java.awt.Point point) {

    /* set all of the buttons to default */
    _newGame.setDefault();
    _continue.setDefault();
    _quit.setDefault();

    /* check if the point is in any of the buttons */
    if (_newGame.contains(point)) {
      _newGame.setHovered();
      this.repaint();

      return _newGame;
    }

    if (_continue.contains(point)) {
      _continue.setHovered();
      this.repaint();
      return _continue;
    }

    if (_quit.contains(point)) {
      _quit.setHovered();
      this.repaint();
      return _quit;
    }

    this.repaint();
    return null;
  }