I am doing the javaswing exercise, and I come across this type of parameter
passing a few times that I am getting very confused, I tried tying it back
to what I learnt from constructor chaining and overload, but I am still
lost, can someone enlighten me please.

Here is the snippet:

 

public class CelsiusConverter implements ActionListener {

    ...

    JButton convertTemp;

    ...

    private void addWidgets() {

        //Create widgets.

        ...

        convertTemp = new JButton("Convert");

 

        //Listen to events from the Convert button.

        convertTemp.addActionListener(this);

        ... 

 

How does "this" refer to convertTemp which I know is an instance of JButton?

 

Thanks

Norman.

 

 


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to