将HTML(流式)呈现到窗格中 [英] Rendering (streaming) HTML into Pane

查看:70
本文介绍了将HTML(流式)呈现到窗格中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的程序同时产生结果。我想追加每个结果,只要它进入swing-thread,就会将结果的html片段渲染成如下形式:

 < ol class =result-type-a>< li class =foo-result>< html-output-of-result ... />< / li> < /醇> 

JTextPane是正确的组件吗?



我的显示信息的流式性质有问题吗?例如只要有新的结果出现,输出就会一步一步地产生,这可能需要每次完整的分析和呈现。

是否有一些完全成熟的Java中的HTML渲染组件(CSS !!)?
或者以其他方式显示HTML格式的结构化,容易格式化的信息?

解决方案

从来没有机会尝试它,但似乎 XHTMLRenderer 对于你。


My program generates results concurrently. I want to append each result, as soon as it enters the swing-thread, to a pane which shall render the result's html-fragment like:

<ol class="result-type-a"><li class="foo-result"><html-output-of-result .../></li></ol>

Is the JTextPane the right component?

Are there problems with my "streaming-nature" of displaying the information; e.g. the output will be generated step by step, as soon as new results come in, which could require a full parse-and-render each time.

Is there some full fledged HTML rendering component in Java (CSS!!) ? Or any other way to display Information in a structured, easily formatted way like HTML+CSS provides?

解决方案

I never had the chance to try it, but seems that XHTMLRenderer may be useful to you.

这篇关于将HTML(流式)呈现到窗格中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆