public synchronized ComboBox < V > addItem ( V item ) { if ( item == null ) { throw new IllegalArgumentException ( "Cannot add null elements to a ComboBox" ) ; } items . add ( item ) ; if ( selectedIndex == - 1 && items . size ( ) == 1 ) { setSelectedIndex ( 0 ) ; } invalidate ( ) ; return this ; }
Adds a new item to the combo box at the end