You are facing that problem simply because if we look inside your constructor, the "button", that you have added to your JFrame is this this one :-
JButton button = new JButton ("Click ME!!");
And you are adding the ActionListener on that button
Because of that the JButton object "button" declared at the class level is hidden in your constructor (to access it you would have had to use the "this" pointer).
And also in your actionPerformed() method when you are checking for the source of event, you are comparing it with the "button" object declared at the class level, (since it cannot see the "button" object declared in your constructor).
So whenever you are clicking your "button", the check e.getSource() == button
fails, and whatever code inside the "if" block is never executed.
Please also remember to wrap your code inside [code=java] and [/code], It maintains indentations and provides syntax highlighting.
edit: I'm looking into this a little more, but I tried it with '==' and it does work, because of how getSource works. I'll run your code and get back to you.
Yes the "==" operator would work correctly here since e.getSource() would return you the reference of the original obect from where the event originated.