• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Groovy vs JavaFX

 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Example #2

Groovy:


JavaFX:
 
Juha Anon
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic