Search code examples
javaeventsjava-native-interface

How to handle DLL events in java project used JNI?


I made Java project using JNI(Java Native Interface).

Java load a DLL file.

the DLL fires Events.

How to handle DLL events in Java program?

When the DLL event is fired, I want to call specific method.


Solution

  • You can register a callback for your native code which corresponds to a method within a class instance or a static method on the Java side.

    See this example for C++