GWT对Java布局管理器有多少支持? [英] How much support does GWT have for Java layout managers?

查看:113
本文介绍了GWT对Java布局管理器有多少支持?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Google Web Toolkit是否仅支持自定义布局管理器,或者Java布局管理器的子集?



例如,是否有可能使用GroupLayout获取Java Swing应用程序并将其获取使用GWT?

解决方案

GWT布局支持是通过Panel的子类完成的。他们中的一些人像'DockPanel'的行为有点像Swing布局(BorderLayout),但你永远无法获得Swing代码并将其编译到GWT中。



<这对GWT来说是一种常见的误解。它是用Java编写的,因为Java是静态类型的,并且被世界级的编辑者广泛支持。它用Java编写的事实与GWT团队希望允许您将SWT / AWT / Swing移植到GWT无关。 Web是与桌面不同的环境,并且由于您的代码最终编译为JavaScript,因此采用任何类型的Java桌面应用程序并点击转换按钮都将毫无意义。这就是Applets多年来试图做的事情......我们都知道结果如何;)


This seems to be a question where the answer is implicit, hence I can't find anything explicit.

Does Google Web Toolkit only support custom layout managers, or a sub-set of the Java layout managers?

For example, is it possible to take a Java Swing application using GroupLayout and get it to work with GWT?

解决方案

GWT layout support is done through subclasses of 'Panel'. Some of them like 'DockPanel' behave a little bit like Swing layouts (BorderLayout) but there's no way you'll ever be able to take Swing code and compile it into GWT.

This is a common mis-understanding when it comes to GWT. It's written in Java solely because Java is statically type and widely supported with world class editors. The fact that it's written in Java has nothing to do with any desire by the GWT team to allow you to port SWT/AWT/Swing to GWT. The web is a different environment to the desktop, and since your code ends up compiled into javascript it would never make sense to take any kind of Java Desktop application and hit the convert button. That's what Applets tried to do many years back...and we all know how that turned out ;)

这篇关于GWT对Java布局管理器有多少支持?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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