In the attached example, if the event is compiled first and then the class file is loaded when compiling the main program, it is not recognized as an event. A proposed fix is attached.
example
example