Normally its a c++ Dll but t here's a handy java wrapper library for the g15. I'll edit this post tomorrow with a link to it once I get home.
Edit: i will probably use this java library to access the screen and its buttons -
http://code.google.com/p/j15/