繁体   English   中英

我将如何使用JSoup在JEditorPane或类似文件上显示文档

[英]How would I use JSoup to display a Document on a JEditorPane or similar

我将能够在窗口中显示JSoup org.jsoup.nodes.Document 我正在做的是从Document doc = Jsoup.connect(URL).get();获取HTML代码Document doc = Jsoup.connect(URL).get(); 我想在一个窗口中显示doc 我将如何去做呢? 另外,如果可以的话,我可以正确设置样式吗?

JSoup是错误的API。 它用于将HTML内容解析为其文档元素。

JEditorPane具有用于设置内容的setPage方法,该方法还将为您提供页面样式:

editorPane.setPage(new URL("http://www.mysite.com"));

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM