title: Click j/ToggleButton then set Icon/Image
body: <p>I am making a 4x4 board kinda like minesweeper. Each button has a bomb or another image.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {                                      
      this.jToggleButton1.setIcon(new javax.swing.ImageIcon("bombaa.png"));          
  }         
  
  private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                         
      this.jToggleButton1.setIcon(new javax.swing.ImageIcon("bombaa.png"));
  }                    
  </code></pre>
  
  <p>also tried this way...</p>
  
  <pre><code>private void setIcon1(){
      setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("bombaa.png")));
  }
  </code></pre>
  
  <p>and call setIcon() in the jButton1ActionPerformed and jButton1MouseClicked BUT this sets my image as the main Icon for the program.</p>
  
  <p>Basically what I need is: Click a button and set the image/icon one time only.</p>