public static String abbreviateName(String str,FontMetrics fm,int width){
  if (fm.stringWidth(str) > width)   str=abbreviateName(str,false);
  if (fm.stringWidth(str) > width)   str=abbreviateName(str,true);
  return str;
}

public static String abbreviateName ( String str , FontMetrics fm , int width ) { if ( fm . stringWidth ( str ) > width ) str = abbreviateName ( str , false ) ; if ( fm . stringWidth ( str ) > width ) str = abbreviateName ( str , true ) ; return str ; }
abbreviate a string as a given name .
