public static AbstractButton getAt(ButtonGroup self, int index) {
        int size = self.getButtonCount();
        if (index < 0 || index >= size) return null;
        Enumeration buttons = self.getElements();
        for (int i = 0; i <= index; i++) {
            AbstractButton b = (AbstractButton) buttons.nextElement();
            if (i == index) return b;
        }
        return null;
    }
public static AbstractButton getAt ( ButtonGroup self , int index ) { int size = self . getButtonCount ( ) ; if ( index < 0 || index >= size ) return null ; Enumeration buttons = self . getElements ( ) ; for ( int i = 0 ; i <= index ; i ++ ) { AbstractButton b = ( AbstractButton ) buttons . nextElement ( ) ; if ( i == index ) return b ; } return null ; }
Support the subscript operator for ButtonGroup.

@param self  a ButtonGroup
@param index the index of the AbstractButton to get
@return the button at the given index
@since 1.6.4