protected double computeAverageCharWidth(FontMetrics metrics,String testString){
  int width=metrics.stringWidth(testString);
  double average=(double)width / testString.length();
  return average;
}

protected double computeAverageCharWidth ( FontMetrics metrics , String testString ) { int width = metrics . stringWidth ( testString ) ; double average = ( double ) width / testString . length ( ) ; return average ; }
computes and returns the average character width of the specified test string using the given fontmetrics . the test string shall represent an " average " text .
