File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Languages and the fly likes Groovy vs JavaFX Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Languages » Other Languages
Bookmark "Groovy vs JavaFX" Watch "Groovy vs JavaFX" New topic
Author

Groovy vs JavaFX

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

I thought I'd post both these code examples as a demonstration. This is about as simple as you can get with both Groovy's SwingBuilder and JavaFX Scripting.

Groovy:


JavaFX Script:


The differences are obvious yet subtle somehow. Obviously differences will arise as things get more complex. Specifically when we begin to add events to the GUI but I thought this was a nice comparison to start out with.

Comments?


GenRocket - Experts at Building Test Data
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Example #2

Groovy:


JavaFX:
Juha Anon
Greenhorn

Joined: May 13, 2007
Posts: 5
When running the JavaFX demo, I can change the GUI and get immediate response: I can see what't the effect of changing a color, size, transparencey, tranform, etc.
Groovy would be a nice language to use instead of JavaFX, but will it be possible to get that immediate feedback?

The challange maybe isn't to write better Groovy version for the JavaFX, but to make Groovy a better development environment for this kind of application.

Competition is good: we need to make the SwingBuilder handle Java2D and animations. If JavaFX can do that, Groovy should also be able to do it.

I have been thinking of using Groovy (and SwingBuilder) for GWT. And the GWT way would work also for JavaFX -- if it ever made it to the browser. We could generate it all from our Groovy source, in the GWT manner -- even if Groovy itself will never be ubiquitous in the browers.
Let JavaFX be the small runtime in the mobile phone, and let Groovy be the development environment we do all the development work in.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Groovy vs JavaFX