java - 为什么 joptionpane 不支持 \t?
问题描述
所以我的问题很简单,为什么 JOptionPane 不允许您使用/不支持“\t”?但是否允许您使用/支持“\n”?
我知道如何通过使用 HTML 或 jTextArea 来解决这个问题......但是这些方法添加了不必要的代码,那么为什么 oracle 不在 JOptionPane 中添加对“\t”的支持,以帮助保持代码简单?
例如 ...
JOptionPane.showMessageDialog(null,"This is the first line" + "\n" + "This is the second line" + "\t" + "< there should be a tab here");
产生这个...
这不是应该发生的事情,因为我正确放置了标签。那么为什么会发生呢?
解决方案
推荐阅读
- python - 在 Python 中使用 pandas 在现有 excel 中添加多个工作表
- reporting-services - 报告标题在 SSRS 报告的新页面上不可见
- ios - 如何将过滤器应用于照片库中的选定图像,而不仅仅是硬编码的图像
- unity3d - 每次发生碰撞时如何继续协程功能?
- java - 如何在每个列表视图中显示内容
- javascript - 语音到带有波浪头像的文本
- qt - 如何设置 qml TreeView 指示器的颜色
- jquery - 将 keydown 事件绑定到 ("ENTER") 键不会发生
- powershell - 加载带有函数的脚本时,PowerShell 会话已终止
- r - 计算聚合数据的滞后