Java - 如何获取插入点左侧的字符(JTextField)
我想获取 JTextField 中插入点左侧的字符。
我已经有了这个:final int pos = input.getCaretPosition();
如何获取此 int
左侧和右侧的字符?
I want to get the character to the left of the insertion point in the JTextField.
I already have this: final int pos = input.getCaretPosition();
How do I get the character to the left and right of this int
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
textField.getText().charAt(pos - 1)
怎么样?what about
textField.getText().charAt(pos - 1)
?