title: Is there a way to disable all buttons with a method?
body: <p>This is a lab for school that I'm struggling with, the code is making a game of hangman, and when the "brain" program says the game is over, all of the letter buttons are supposed to be disabled.</p>
  
  <p>relevant code sections:</p>
  
  <p>the buttons:</p>
  
  <pre><code>class ActionButton extends JButton implements ActionListener{
      private String name;
      private char t;
      public ActionButton(String s){
          super(s);
          name = s;
          t = name.charAt(0);
      }
  
      @Override
      public void actionPerformed(ActionEvent e) {
          ido.newLetter(t);
          this.setEnabled(false);
          LovesMePanel.this.update();
      }
  
  }
  </code></pre>
  
  <p>the update method:</p>
  
  <pre><code>public void update(){
      answers = ido.getAnswer();
      flower.setTriesLeft(ido.getTriesLeft());
      progress.setText(answers);      
      if(ido.gameOver()){
  // This is where I need to deactivate the buttons       
          if(ido.hasWon()){
  
          }
      }
      else if(triesLeft == 0){
  
      }
  
  }
  </code></pre>
  
  <p>the buttons are all created in a loop in the LoveMePanel that holds all of the other panels. Is there a way to reference them all or disable them all when the game is over?
  If not, how should I change my code so that it would be possible to do that?</p>