First, make sure you're using wired XBOX controllers. Wireless controls of any sort are illegal in competition.
Here's the class we use:
https://github.com/team1306/Badgerbo...ontroller.java
Just use XBoxController xcon = new XBoxController(
port #); to instantiate it and xcon.get
Whatever(); to access it. Joysticks and triggers are returned as doubles and buttons are returned as booleans.
To program TankDrive, you can simply assign the Y-axis of the left joystick to the left motor(s) and the Y-axis of the right joystick to the right motor(s). I recommend cubing the inputs for better control and dealing with the deadband. (You'll want at least a 10 percent deadband.)
Note the comment regarding the triggers. We've never had an issue with it, but it's something to be aware of. (It's also unavoidable, since it has to do with how Windows reads the controller.)