if (text.charAt(prevIndex) == '\n' || text.charAt(prevIndex) == ' ') { prevIndex++; }
  int paint(Graphics g)  {		if (text == null) {			return 0;		}		int i, prevIndex, y;		Font f = Font.getDefaultFont();    for (i = prevIndex = y = 0; i < numOfBreaks; i++) {      if (invertPaint) {        g.setGrayScale(0);      } else {        g.setGrayScale(255);      }      g.fillRect(0, y, width, f.getHeight());      if (invertPaint) {        g.setGrayScale(255);      } else {        g.setGrayScale(0);      }      g.drawSubstring(text, prevIndex, breaks[i] - prevIndex, 0, y, 0);			prevIndex = breaks[i];      if (text.charAt(prevIndex) == '\n' || text.charAt(prevIndex) == ' ') {				prevIndex++;			}			y += f.getHeight();    }		if (prevIndex != text.length()) {	    if (invertPaint) {	      g.setGrayScale(0);	    } else {	      g.setGrayScale(255);	    }	    g.fillRect(0, y, width, f.getHeight());	    if (invertPaint) {	      g.setGrayScale(255);	    } else {	      g.setGrayScale(0);	    }	    g.drawSubstring(text, prevIndex, text.length() - prevIndex, 0, y, 0);			y += f.getHeight();		}		return y;  }