title: Java JFrame actionPerformed
body: <p>I'm not used to Java and JFrame as I'm just starting to learn.</p>
  
  <p>My question is that, I have error at the method <code>actionPerformed</code>. The error given is at the <code>e.getsource == b</code> I believe.</p>
  
  <p>From what I understand, the button I created at the <code>public static void main(String[] args)</code> doesn't passed the value of the button to the <code>actionPerformed</code>.</p>
  
  <p>I'm sorry if my question is not clear.</p>
  
  <p>Here is my code</p>
  
  <pre><code>public static void main(String[] args){
  
      JButton b = new JButton("Click here");
  
      JFrame newWindow = new JFrame("Test");
  
      newWindow.setVisible(true);
      newWindow.setSize(250,250);
      newWindow.setLayout(null);
  
      newWindow.add(b);
  
      b.addActionListener(this);
  
  }
  </code></pre>
  
  <p>Here is another part of my code</p>
  
  <pre><code>public void actionPerformed(ActionEvent e)
  {
      if ( e.getSource() == b )
      { 
          //do something 
      }
  }
  </code></pre>