html - 如何让 html 格式显示在 JOptionPane 中?
问题描述
我不明白为什么这不起作用。
String address = "somebody@abc.com";
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.INFORMATION_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'>Someone@abc.com</font></html>",
"About",JOptionPane.INFORMATION_MESSAGE);
解决方案
推荐阅读
- java - 无法从 Android Studio 中的 Firebase 获取所有价值
- ios - iPad 的 AVVideoPreviewLayer 重力
- c++ - 为什么我在此代码中收到 SIGABRT 错误
- nlp - 任务名称 - 拆分复杂的句子?
- sql - Bigquery 将“2016 年 1 月 30 日上午 12:00”转换为日期
- azure - Azure 多租户 SAAS/PAAS?
- python-3.x - 如何修复第三个打印语句?
- java - 从 Java 资源获取数据没有返回数据
- vue.js - 为什么 VS Code 无法获取 Vue 的类型?
- ios - 在主视图中按下按钮时,如何在弹出视图控制器中更改标签的标签文本?