有没有办法以 HTML/XML 方式呈现 JAVA 组件/容器?
我不知道正在为 java 开发工具,但我认为创建一个引擎来解释类似 xml/html 的字符串并将它们呈现为容器和组件对象树是一个好主意。示例:
<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>
相当于:
...
啊,我不会在这里写几千行代码,你知道什么意思!
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. 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!!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过在 Google 中搜索“XML To String”,您可以看到有专门用于此目的的框架:
我个人从未使用过它们,但你可以尝试一下。
By searching "XML To String" in Google, you can see there are frameworks dedicated to that :
I personnaly never used them, but you could give it a try.