implemented messagelistner and paintable