(1) In order to connect the LeapMotion controller, create the Controllers object, which automatically creates a connection with the controller's service or daemon, and then captures the data provided to your application. You can use this object to obtain connection information.
(2) Get frames: can be obtained through the Controller object's Onframe () method, you can call this method at any time when your program needs to obtain a set of data of the controllers, also can implement the listener interface to obtain.
(3) Previous applications and background applications: The LeapMotion service program typically only sends captured data to applications that have the operating system input focus. If your application is running in the foreground, and you want to know if the LeapMotion service is serving your front-end program, you can use the Controller.hasfocus () method or the event that listens to the controller. When the focus of the application changes, the service object of the controller's service program also changes.
LeapMotion Controller Java Language Development Note-(Connection controller)