Jsoup を使用して Java で HTML ドキュメントを作成するだけです。以下はコードの一部です
public static Document genDoc(String p) throws ProtocolException, IOException, InterruptedException, ParserConfigurationException{
........
return Jsoup.parseBodyFragment(html);
}
ドキュメントの生成が完了したら、それを表示する必要があります。FlyingSaucer の XHTML パネルを使用するだけです。これがコードです
public static void main(String[] args) throws ProtocolException, IOException, InterruptedException, ParserConfigurationException{
Document doc = genDoc("http://www.mangareader.net/93-1-11/naruto/chapter-1.html");
XHTMLPanel xhp = new XHTMLPanel();
xhp.setDocument(doc);
........
}
クラス org.jsoup.nodes.Document は「org.w3c.dom.Document」から継承されていると思いました。しかし、私は間違っていました。「org.jsoup.nodes.Document」のオブジェクトを渡して、最初に文字列または入力ストリームまたはバイト [] に変換せずに、XHTMLPanel を使用して Web ビューを生成する方法はありますか?