jinput problem

i want to write a simple program that if usb controller(a) press 1, then i terminal will display “Controller : 1, Button 1”, controller(b) press 1, display “Controller : 2, Button 1”. how to write? i’m still fresh in java and also in programming. hope someone will guide me.