String previousText = editorPane.getText();
String compiledString = previousText + "<br>" + message;
editorPane.setText(compiledString);
上面的代码不起作用,它不会更新我的JTextPane,但如果我修改代码并将其更改为:
String previousText = editorPane.getText();
String compiledString = previousText + "<br>" + message;
editorPane.setText(message);
它完美无缺!我做错了什么,看不到它?