Passing events to java