有谁知道为什么 tab (\t) 不能与 JOptionPane.showMessageDialog 一起使用?
我的代码如下:
String addText = "NAME\t\tADDRESS\t\tTEL.No\tEMAIL\n";
for (int i = 0; i < addressBookSize; i++) {
addText = addText+entry[i].viewAllInfo();
}
System.out.print(addText);
JOptionPane.showMessageDialog(null, addText);
还有其他方法可以在 JOptionPane 中对齐文本吗?