我正在使用我的 java 应用程序从网站上抓取数据,并希望在用 Swing 制作的文本区域中解析 html 页面代码后显示结果。
文本如:hello <b>every</b>one
应在文本区域中显示为:'hello everyone'。
谢谢!!
最佳答案
JEditorPane ep = new JEditorPane();
ep.setContentType("text/html");
ep.setText("html code");
关于java - 如何在java应用程序的文本区域显示html格式的文本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2441584/