Caret « Text Input « Java Swing Q&A





1. JFace question: how to get caret position in text editor    coderanch.com

Hi all, I'm working on a simple Eclipse plugin that should insert some text into the active editor in response to a menu command which invokes an InputDialog. Everything works, including inserting the text, but I have run into one stumbling block: I cannot figure out how to insert the text at the current caret position. Here is what I have ...

2. Problem with caret position using JFormattedTextField w/ DefaultFormatter    coderanch.com

This is viewed with locale-appropriate delimiters, so for me (in the U.S.) is shows "87,654,321" until I click on the field and it drops the commas. Now if I were to use Mr. Camick's mouse adapter on this field and click between the 3 and the 2, the mouse adapter would set the caret between the 2 and the 1 because ...