public void removeProject(String projectName){
  Iterator<String> it=recentProjectsList.iterator();
  while (it.hasNext()) {
    if (projectName.equals(it.next())) {
      it.remove();
    }
  }
}

public void removeProject ( String projectName ) { Iterator < String > it = recentProjectsList . iterator ( ) ; while ( it . hasNext ( ) ) { if ( projectName . equals ( it . next ( ) ) ) { it . remove ( ) ; } } }
remove project filename from the recently - used project list .
