Using the EventArgs
<p>what is the java equivalent method "getSource()" in C# language</p>

<pre><code>public void actionPerformed(ActionEvent e) 
{ 
   if(e.getSource().equals(button1)){
      //some code here
     }
}
</code></pre>
