JEditorPane 滚动到当前插入符位置
我有一个 JEditorPane,用来显示 HTML 文档。该文档中嵌入了超链接。当用户单击书签时,插入符号将定位到 JeditorPane 中的关联位置。然后假设 JeditorPane 滚动到这个位置。这大部分有效。但是,我注意到,如果文档中嵌入了很多“中断标签”(BR) 标签,则滚动不会将 JEditorPane 定位到正确的位置。就像标签摆脱了称呼一样。对此有何建议?
I have a JEditorPane which I use to display an HTML document. the document has hyperlinks embedded in it. When a user clicks on a bookmark a position the caret to the associated place in the JeditorPane. The JeditorPane is then suppose to scroll to this position. This works mostly. But, I noticed that if the document has a lot of "break tags" (BR) tags embedded in it, the scrolling does not position the JEditorPane to right place. It's like the tags throw the callebration off. Any suggestions on what to do about this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我弄清楚了根本问题,并想重述问题,而不是根据原始问题引起混乱。我希望 stackoverflow 允许撤回问题!
I figured out the underlying problem and want to restate the question rather than cause confusion based on the original question. I wish stackoverflow allowed questions to be withdrawn!