Caret position in JTextField with selected text
I was trying to somehow set my caret position to 0 while I have all of the text selected in a JTextField. I have an event that will select all text upon receiving focus but it automatically puts the cursor at the end of the text field. But if i use the setCaretPosition(0) after that it will deselect all of the text.
txtProdLine.addFocusListener(new java.awt.event.FocusAdapter(){
publicvoid focusGained(java.awt.event.FocusEvent evt){
txtProdLine.selectAll();
}
});
I know I may be getting a little picky here but any help would be appreciated.

