@Override
    public int getButtonCount() {
        return buttons.size();
    }
Returns the number of buttons on this joystick.

@return the number of buttons on this joystick.
jme3-core/src/main/java/com/jme3/input/AbstractJoystick.java