Two Laptop Bag*
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Languages » Other Languages
Bookmark "Groovy vs JavaFX" Watch "Groovy vs JavaFX" New topic

Groovy vs JavaFX

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299

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.


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.


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

Joined: Jul 11, 2001
Posts: 15299

Example #2


Juha Anon

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.
It is sorta covered in the JavaRanch Style Guide.
subject: Groovy vs JavaFX
Similar Threads
Books on JAVAFX?
Anyone tried out JavaFX?
displaying an image in a groovy gui
How does inner class access outter class functions?