Code example for JTextComponent

Methods: getCaretPosition

0
		this.component.setCaretPosition(start);
		this.component.moveCaretPosition(end);
	} 
 
	public int getCaretPosition() { 
		return this.component.getCaretPosition();
	} 
 
	public String getText() {
		return this.component.getText();
	} 
 
	public void replaceSelection(String newString) {
		this.component.replaceSelection(newString);
	} 
 
	public void requestFocus() { 
		this.component.requestFocus();
	}