int maxLength(){
  FontMetrics fm=getFontMetrics(getFont());
  int m=0;
  int end=items.size();
  for (int i=0; i < end; i++) {
    int l=fm.stringWidth(((String)items.elementAt(i)));
    m=Math.max(m,l);
  }
  return m;
}

int maxLength ( ) { FontMetrics fm = getFontMetrics ( getFont ( ) ) ; int m = 0 ; int end = items . size ( ) ; for ( int i = 0 ; i < end ; i ++ ) { int l = fm . stringWidth ( ( ( String ) items . elementAt ( i ) ) ) ; m = Math . max ( m , l ) ; } return m ; }
return the length of the largest item in the list
