如何在JOptionPane中显示html格式?

问题描述

我不明白为什么这不起作用。

String address = "[email protected]";
String htmlText = "<html><br><font color='red'>" + address + "</font></html>";

JOptionPane.showMessageDialog(Component,"My App v0 \n\n" + 
                            "Send questions or comments to: " + htmlText,"Questions",JOptionPane.@R_966_4045@ION_MESSAGE);

消息框中显示的是地址周围的html标记...与htmlText赋值完全一样。

我希望只会看到应用了html格式的地址。

我将所有的html和地址放在字符串中,仍然得到相同的结果:

JOptionPane.showMessageDialog(toolbar,"WFM Network Calculator Version 0.6 
   \n\n" + "Send questions or comments to: <html><br><font 
   color='red'>[email protected]</font></html>","About",JOptionPane.@R_966_4045@ION_MESSAGE);

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)