学习是最好的投资!
Use JTextField 的 setCaretPosition 方法,可以设置光标的位置。在设置完 JTextField 的 text 之后,调用 setCaretPosition(0) to move the cursor to the front to get the effect you need.
JTextField
setCaretPosition
setCaretPosition(0)
Use
JTextField
的setCaretPosition
方法,可以设置光标的位置。在设置完
JTextField
的 text 之后,调用setCaretPosition(0)
to move the cursor to the front to get the effect you need.