title: How to addActionLister to button in Static method
body: <p>I have a problem in how to addActionListener for a button in static method</p>
  
  <p>here is my static method </p>
  
  <pre><code>private static void initComponents() {
  
  
      btnExit = new JButton("Exit");
      btnExit.addActionListener(this);  &lt;==== this is error
  
  
  }
  </code></pre>
  
  <p>do you guys have any idea
  in how to add a listener so that the button response when clicked</p>