JEdi​​torPane 滚动到当前插入符位置

发布于 2024-08-27 02:21:05 字数 196 浏览 4 评论 0原文

我有一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不即不离 2024-09-03 02:21:05

我弄清楚了根本问题,并想重述问题,而不是根据原始问题引起混乱。我希望 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!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文