What does "this" mean in this program?
<p>I was writing a program, and then I saw this on some website that is using the <code>this</code> keyword in this code, and I was wondering what it's purpose, it can process a Jbutton, or JTextField, it can show message using the this keyword, what happened to <code>getSource()</code>?</p>

<p>Here's the code</p>

<pre><code>import java.awt.FlowLayout;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JFrame;
import javax.swing.JPasswordField;
import javax.swing.JOptionPane;
import javax.swing.JTextField;
import javax.swing.JButton;

public class TextPassWordEvent extends JFrame {

    private JTextField textField1;
    private JTextField textField2;
    private JTextField textField3;
    private JPasswordField passwordField;
    private JButton button;

    public TextPassWordEvent(){
        super("Title");
        setLayout(new FlowLayout());

        textField1 = new JTextField(10);
        add(textField1);

        textField2 = new JTextField("Enter your Text Here");
        add(textField2);

        textField3 = new JTextField("Uneditable Text field");
        textField3.setEditable(false);
        add(textField3);

        passwordField = new JPasswordField("Password");
        add(passwordField);

        button = new JButton("Submit");
        add(button);

        TextHandler handler = new TextHandler();
        textField1.addActionListener(handler);
        textField2.addActionListener(handler);
        textField3.addActionListener(handler);
        passwordField.addActionListener(handler);
        button.addActionListener(handler);
    }

    private class TextHandler implements ActionListener{

        public void actionPerformed(ActionEvent event){
            JOptionPane.showMessageDialog(TextPassWordEvent.this, String.format("Message: %s",event.getActionCommand()));
        }
    }

}
</code></pre>
