Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-swt-dev] listeners pattern

Hi, can someone explain me why in all examlpes of custom widgets in
SWT I found, there is always sth like :
class XXX extends Canvas {
//
		addPaintListener(new PaintListener() {
			public void paintControl(PaintEvent e) {
				XXX.this.paintControl(e);
			}
		});
//
}
Why not :
class XXX extends Canvas implements PaintListener {
//
    addPaintListener(this);
//
}

Should I avoid using implementing listener interfaces or is it only
populated someone style of writing?

Thanks,
Albert

 



Back to the top