将java中的HTML与现有变量一起使用
我试图使用LinkedList的内容在JTextArea中创建一个表。现在我有:
for(int i = 0; i < commands.size(); i++) {
String row = "<html><table><tr><td>"+commands.get(i)+"</td><td>"+desc.get(i)+"</td></tr></table></html>";
MainConsole.console.textArea.append(row+"\n");
}
但是,在编译时,它仍然是纯文本: 1
有没有关于展示桌子的建议
提前谢谢
# 1 楼答案
TextArea用于显示简单文本,而JEditorPane用于显示HTML文本