this.caretRowLastPart = textLine.substring( this.caretColumn );
if ( textLine.length() > 1 && textLine.charAt( textLine.length()-1) == '\n') { if ( textLine.length() - 1> this.caretColumn) { this.caretRowLastPart = textLine.substring( this.caretColumn, textLine.length() - 1 ); } else { this.caretRowLastPart = ""; } } else { this.caretRowLastPart = textLine.substring( this.caretColumn ); }
	public void setCaretPosition(int position) {		//#if polish.blackberry			this.editField.setCursorPosition(position);		//#elif tmp.allowDirectInput || tmp.forceDirectInput			if ( ! this.isInitialised ) {				this.doSetCaretPosition = true;				this.caretPosition = position;			} else if (this.realTextLines == null ){				// ignore position when there is not text present			} else {				int row = 0;				int col = 0;				int passedCharacters = 0;				String textLine = null;				for (int i = 0; i < this.realTextLines.length; i++) {					textLine = this.realTextLines[i];					passedCharacters += textLine.length();					//System.out.println("passedCharacters=" + passedCharacters + ", line=" + textLine );					if (passedCharacters >= position ) {						row = i;						col = textLine.length() - (passedCharacters - position);						break;					}				}				//#debug				System.out.println("setCaretPosition, position=" + position + ", row=" + row + ", col=" + col );				this.caretRow = row;					this.caretColumn = col;								textLine = this.textLines[ row ];				this.originalRowText = textLine;				String firstPart;				if (this.caretColumn < textLine.length()) {					firstPart = textLine.substring(0, this.caretColumn);					this.caretRowLastPart = textLine.substring( this.caretColumn );					this.caretRowLastPartWidth = this.font.stringWidth( this.caretRowLastPart );				} else {					firstPart = textLine;					this.caretRowLastPart = "";					this.caretRowLastPartWidth =  0;				}				this.caretRowFirstPart = firstPart;				this.caretX = this.font.stringWidth( firstPart );				this.internalY = this.caretRow * this.rowHeight;				this.caretY = this.internalY;				repaint();			}		//#endif	}