Code example for JTextComponent

Methods: getCaretPositiongetSelectionEndgetSelectionStartgetTextselectsetCaretPositionsetText