title: Pressing button to make a thread do its work
body: <p>I have a class named <code>Card</code> and this class extends <code>Thread</code>
  so I have an override of the method <code>run()</code> and it says:</p>
  
  <pre><code>@Override
  public void run() {
      while (true) {
          while (Bingobtn == pressed) {
              System.out.println("Thread working is: " + this.ID);
              this.d.getDetails(size, this, frmBingo);
              Thread t1 = new Thread(d);
              t1.start();
              Bingobtn = 0;
          }
      }
  }
  </code></pre>
  
  <p>I initialize <code>static Bingobtn = 0</code> and <code>static pressed =1</code>, so I have a button in this class (<code>Card</code>) whenever I press the button I gave an <code>action:istener</code> that <code>Bingobtn=1</code>;</p>
  
  <pre><code>Bbtn = new JButton("Bingo");
  Bbtn.setBackground(Color.YELLOW);
  Bbtn.setFont(new java.awt.Font("Castellar", java.awt.Font.BOLD, 22));
  Bbtn.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
          Bingobtn = 1;               
      }
  });
  </code></pre>
  
  <p>But the problem here that the <code>while(Bingobtn == pressed)</code> never is true, even I press the bingo button... it's like the <code>Bingobtn</code> never equals 1!</p>