When you want to use Pi4J in your project, you should definitely check out the Pi4J website where you can find a lot of information and many examples! For example, for a minimal example to blink a LED ...
JNativeHook is a library to provide global keyboard and mouse listeners for Java. This will allow you to listen for global shortcuts or mouse motion that would otherwise be impossible using pure Java.