if (listingMode == JFileChooser.FILES_ONLY) return contents.get(directories + index); else
  public Object getElementAt(int index)  {    if (index > getSize() - 1)      return null;    if (listingMode == JFileChooser.FILES_ONLY)      return contents.get(directories + index);    else      return contents.elementAt(index);  }