public void fileDialogAction (MyFileDialog f, int action) {
    if (action == MyFileDialog.OKAY) {
      if (f.getMode() == MyFileDialog.LOAD) {
        WindowRegistry.saveCursors();
	WindowRegistry.setAllCursors (WAIT_CURSOR);
        try {
          if (f.isURL())
	    new SynthWindow (f.getURL()).show();
          else 
            new SynthWindow (f.getF()).show();
        }
        catch (Exception e) { new ExceptionDialog (this, e).show(); }
	finally {
	  WindowRegistry.restoreCursors();
	}
      }
      else {
        OutputStream fout = null;
	WindowRegistry.saveCursors();
	WindowRegistry.setAllCursors (WAIT_CURSOR);
        try {
	  fout = f.getOutputStream();
          fout = new FileOutputStream (f.getF());
          synthCanvas.save (fout);
	  if (f.isURL()) {
	    url = f.getURL();
	    file = null;
	    name = url.toString();
	  } else {
	    file = f.getF();
	    url = null;
	    name = file.toString();
	  }
	  setTitle();
	  saveMenuItem.enable();
        }
        catch (Exception e) { new ExceptionDialog (this, e).show(); }
	finally {
	  try {
	    if (fout != null) fout.close();
	  } catch (IOException e) {}
	  WindowRegistry.restoreCursors();
	}
      }
    }
  }