function setDesktopGroupName(fig,name)
%setDesktopGroupName(FIG,NAME) Assigns FIG to the document group named
%NAME so that if FIG is docked it will show up in the NAME group. 

%   Copyright 1993-2004 The MathWorks, Inc.  
%   $Revision: 1.1.8.1 $  $Date: 2004/08/10 01:50:36 $

% Note, this uses an undocumented MATLAB feature which may change in a
% future release.
jf = get(fig,'JavaFrame');
jf.setGroupName(name)
