There is a function called getButton() that allows you to use the trigger and top button, and one called getRawButton() that works for the rest of the buttons by number. This page should help you get a complete understanding of the joystick, the buttons, and the rest of the code for the robot.
http://www.wbrobotics.com/javadoc/ed...ge_description