Java 1.1, AWT (no Swing, please) I'm using the constructor TextField("http://"); This component has the focus. I want to automatically place the cursor after the 'http://' Can it be done in AWT? Thank you! Drew
There's a handy method called setCaretPosition() that should do the trick. It takes an "int" parameter for the position of the caret (cursor). Anything bigger than the length of the text will cause the caret to appear at the end, so I would use: setCaretPosition(Integer.MAX_VALUE);