Is Google Web Toolkit similar to AWT and Swing

前端 未结 7 1055
遇见更好的自我
遇见更好的自我 2020-12-30 09:46

I\'ve looked breifly into GWT and like the idea that I can develop in Java and have the application compile down to HTML and JavaScript. Is the concept behind GWT and AWT an

相关标签:
7条回答
  • 2020-12-30 10:19

    disclamer: While I do work at IT Mill, this is just for information to the original poster. This isn't marketing spam.

    If you like the idea of being able to write Java and get a webpage out of that, you might be interested in IT Mill Toolkit. It's a toolkit for making RIA software on top of a J2EE stack, and it uses GWT heavily.

    One of the basic ideas are that the code generated by GWT is just as prone to client-side forging attacks as any other JS/Ajax-traffic. IT Mill Toolkit makes sure that the data is validated server-side too.

    The toolkit is also designed in such a way that if you are familiar to Swing, you should have no problems picking it up.

    0 讨论(0)
  • 2020-12-30 10:25

    AWT and Swing are for programming stand-alone applications (and to a lesser extent, applets). GWT is supposed to make programming web applications similar to stand-alone apps. I wouldn't program a non-web app using GWT.

    0 讨论(0)
  • 2020-12-30 10:28

    Define concept.

    AWT/Swing are used for desktop Java apps or applets. They both require JVM to run.

    GWT is used to translate Java code to Javascript. This only runs on Javascript engines, i.e. browser.

    The API design, as stated above, is similar to Swing. You get the same Panels, Buttons and other Component classes as in Swing.

    0 讨论(0)
  • 2020-12-30 10:29

    GWT is a javascript toolkit that allows you to write the javascript in Java. The only real similarities to Swing and AWT are that they are toolkits for creating user interfaces and they use Java. The end product is different and the real purpose for using them is different. GWT gives you the ability to generate a ajax user interface for a web browser while the other 2 give you a console (or applet) java app. In my mind the real reason for using GWT is to get a quick ajax interface up for prototyping purposes. But I dont think its really production ready- ie I dont thing Google uses it in their own webapps. A better choice for more robust ajax webapps is http://developer.yahoo.com/yui/ or http://script.aculo.us/.

    0 讨论(0)
  • 2020-12-30 10:33

    GWT is very much similar to Swing in its usage of Widgets, Panels and the EventListeners it provides. A different way to look at GWT is to think of Javascript and HTML as Assembly language and GWT as a sort of High level language which generates Javascript and HTML. With GWT its easy to develop desktop-like apps for the web using the same tools you would use for building a desktop app

    0 讨论(0)
  • 2020-12-30 10:36

    It is programmed very similarly(patterned after Swing) and the code is 100% java (compiles with a standard Java compiler without errors), but the way it works is very different. Instead of compiling into a Java app, it compiles into Javascript that is sent to your browser.

    This ability to program good active Javascript without actually coding Javascript and HTML is pretty nice.

    Also, since it programs much like swing, you can do stuff like adding listeners that effect other controls pretty easily.

    0 讨论(0)
提交回复
热议问题