return maxWidth;
return pixelX - x;
  public static final int getTabbedTextWidth(Segment s, FontMetrics metrics,                                             int x, TabExpander e,                                             int startOffset)  {    // This buffers the chars to be drawn.    char[] buffer = s.array;    // The current x coordinate.    int pixelX = x;    // The current maximum width.    int maxWidth = 0;    for (int offset = s.offset; offset < (s.offset + s.count); ++offset)      {	switch (buffer[offset])	  {	  case '\t':	    // In case we have a tab, we just 'jump' over the tab.	    // When we have no tab expander we just use the width of 'm'.	    if (e != null)	      pixelX = (int) e.nextTabStop(pixelX,					   startOffset + offset - s.offset);	    else	      pixelX += metrics.charWidth(' ');	    break;	  case '\n':	    // In case we have a newline, we must 'draw'	    // the buffer and jump on the next line.	    pixelX += metrics.charWidth(buffer[offset]);	    maxWidth = Math.max(maxWidth, pixelX - x);	    pixelX = x;	    break;	  default:	    // Here we draw the char.	    pixelX += metrics.charWidth(buffer[offset]);	    break;	  }      }    // Take the last line into account.    maxWidth = Math.max(maxWidth, pixelX - x);    return maxWidth;  }