public synchronized V removeItem ( int index ) { V existing = items . remove ( index ) ; if ( index < selectedIndex ) { selectedIndex -- ; } while ( selectedIndex >= items . size ( ) ) { selectedIndex -- ; } invalidate ( ) ; return existing ; }
Removes an item from the list box by its index . The current selection in the list box will be adjusted accordingly .