【发布时间】:2016-02-22 13:21:56
【问题描述】:
使用Hyperlink in jEditorPane 链接,我设法在 jEditorPane 中获取了超链接。
但现在我想将悬停效果添加到超链接。 我尝试使用
MyHTMLEditorKit kit = new MyHTMLEditorKit();
setEditorKitForContentType("text/html", kit);
addHyperlinkListener(createHyperlinkListener());
StyleSheet css= kit.getStyleSheet();
css.addRule("a { color: red;}");
MyHTMlEditorKit 扩展 HTMLEditorKit。
我也尝试遵循 CSS,但没有成功。
a:hover{color:red;}
另外,我尝试了超链接中的onmouseover="this.style.color='red'" 属性,但即使它也没有用。
那么如何在 jEditorPane 中实现超链接的onhover 效果呢?
【问题讨论】:
标签: java html css swing hyperlink