code: public void intervalAdded (ListDataEvent e)
      {
          int start = e.getIndex0(), count = e.getIndex1() - start + 1;
  
          // adjust the selected index
          if (_selectedIndex >= start) {
              _selectedIndex += count;
          }
  
          // add buttons for the new interval
          addButtons(start, count);
      }
docs: documentation inherited from interface