Just because you implement
the interface, doesn't mean that your implementation is used.
Let me give you an example:
public class FancyButton extends Button implements SomeFancyButtonListener
{
public FancyButton()
{
// This line is necessary, otherwise the implemented code isn't used.
this.addFancyButtonListener(this);
}
@Override
public void fancyButtonClicked(FancyClickEvent e)
{
// Do something
}
}
is equivalent to:
public class FancyButton extends Button
{
public FancyButton()
{
this.addFancyButtonListener(new SomeFancyButtonListener()
{
@Override
public void fancyButtonClicked(FancyClickEvent e)
{
// Do something
}
});
}
}
From what I can see in your first code snippet, you aren't adding this
as the Handler
.