public static String getMediaPath(String fileName) 
  {
    String path = null;
    String directory = getMediaDirectory();
    boolean done = true;
    
    // if the directory is null 
    if (directory == null)
    {
      // try to find the mediasources directory
      try {
        // get the URL for where we loaded this class 
        Class<?> currClass = Class.forName("FileChooser");
        URL classURL = currClass.getResource("FileChooser.class");
        URL fileURL = new URL(classURL,"../mediasources/");
        directory = fileURL.getPath();
        File dirFile = new File(directory);
        if (dirFile.exists()) {
          setMediaPath(directory);
          done = true;
        }
      } catch (Exception ex) {
      }
      if (!done)
      {
        
        SimpleOutput.showError("The media path (directory)" +
                               " has not been set yet!  " +
                               "Please pick the directory " +
                               "that contains your media " +
                               "(usually called mediasources) " +
                               "with the following FileChooser.  " +
                               "The directory name will be stored " +
                               "in a file and remain unchanged unless you use " +
                               "FileChooser.pickMediaPath() or " +
                               "FileChooser.setMediaPath(\"full path name\") " +
                               "(ex: FileChooser.setMediaPath(\"c:/intro-prog-java/mediasources/\")) " +
                               " to change it.");
        pickMediaPath();
        directory = getMediaDirectory();
      }
    }
    // get the full path
    path = directory + fileName;
    return path;
  }