简体   繁体   English

有没有办法以HTML / XML方式呈现JAVA组件/容器?

[英]Is there a way to render JAVA components/containers in a HTML/XML fashion?

I'm not aware of tools that are being developed for java, but i think it would be a good idea to create an engine that would interpret xml/html-like strings and render them into a tree of container and component objects. 我不知道为Java开发的工具,但是我认为创建一个引擎来解释类似xml / html的字符串并将其渲染为容器和组件对象树是一个好主意。 Example: 例:

<JFrame title="This is a GUI stand-alone App">
    <JPanel bgColor="blue">
        <JPanel align="center">Some Text</JPanel>
        <JButton align="bottom" value="click" />
    </JPanel>
</JFrame>

Would be equivalent to: 等效于:

...

ah, I'm not going to write thousand lines of code here, you know what mean!!! 啊,我不会在这里写上千行代码,你知道这是什么意思!!!

By searching "XML To String" in Google, you can see there are frameworks dedicated to that : 通过在Google中搜索“将XML转换为字符串”,您可以看到一些专用于此的框架:

I personnaly never used them, but you could give it a try. 我个人从未使用过它们,但是您可以尝试一下。

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

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