title: Understanding ActionListener
body: <p>I just started getting my head around Java itself and Java Swing and I have some problems understanding the "Action Listener" concept. People say that C# and Java is very alike, but that's another story when you actually try out both of them and compare.</p>
  
  <p>I have the following auto-generated Action Listener for a button:</p>
  
  <pre><code>btnNewButton.addActionListener(new ActionListener() 
  {
      public void actionPerformed(ActionEvent e) 
      {
          lblNylabel.setText("New label text");
      }
  });
  </code></pre>
  
  <p>I understand it like this:</p>
  
  <ol>
  <li>You call a non-static method via the object "btnNewButton" <strong>btnNewButton.addActionListener()</strong></li>
  <li>The method takes one ActionListener instance as an argument</li>
  <li>The automated code instansiates an ActionListener instance via the "new ActionListener()" constructor call - What I don't understand is that I can't instansiate the ActionListener class myself, but it's possible as an argument in the method call??</li>
  <li>A "actionPerformed" method is generated inside the new instance body and used here (What?)</li>
  <li>Inside the "actionPerformed" method you define what to do, when the button is clicked - Makes perfectly sense</li>
  </ol>
  
  <p>Is it possible to do this in a more understanding/simple way that could help me understand the ActionListener concept?</p>