public File createNewFolder(File containingDir) throws IOException {
  File result=new File(containingDir,"New folder");
  if (result.exists()) {
    throw new IOException("Directory 'New folder' exists");
  }
  if (!result.mkdir()) {
    throw new IOException("Cannot create directory");
  }
  return result;
}

public File createNewFolder ( File containingDir ) throws IOException { File result = new File ( containingDir , "New folder" ) ; if ( result . exists ( ) ) { throw new IOException ( "Directory 'New folder' exists" ) ; } if ( ! result . mkdir ( ) ) { throw new IOException ( "Cannot create directory" ) ; } return result ; }
creates a new folder with the default name " new folder " . this method is invoked when the user presses the " new folder " button .
