Implemented the listener on the panel buttons.