Moved listener handling from Frame to Component.