The addActionListener(ActionListener listener) expects an action listener type. In your code,
this is GUIsampler i.e. a JFrame instance.
In other words you say have a beer but you actually pass a glass of milk. No wonder the compiler is complaining. I would too if you gave me milk instead of beer