question: public void insertSeparator ( int index ) { synchronized ( getTreeLock ( ) ) { if ( index < 0 ) { throw new IllegalArgumentException ( "index less than zero." ) ; } int nitems = getItemCount ( ) ; Vector < MenuItem > tempItems = new Vector < > ( ) ; for ( int i = index ; i < nitems ; i ++ ) { tempItems . addElement ( getItem ( index ) ) ; remove ( index ) ; } addSeparator ( ) ; for ( int i = 0 ; i < tempItems . size ( ) ; i ++ ) { add ( tempItems . elementAt ( i ) ) ; } } }
target:  Inserts a separator at the specified position.