GeeCON Prague 2014*
The moose likes JavaFX and the fly likes Would you recommend using Groovy for writting Java Fx applications? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JavaFX
Bookmark "Would you recommend using Groovy for writting Java Fx applications?" Watch "Would you recommend using Groovy for writting Java Fx applications?" New topic
Author

Would you recommend using Groovy for writting Java Fx applications?

Dragan Stankovic
Ranch Hand

Joined: Oct 14, 2008
Posts: 33
I am wondering if one is able to choose programming language to use with JavaFx platform would you consider using Groovy or you would stay with the default scripting language?

http://www.expertaya.com
Eric Bruno
author
Ranch Hand

Joined: Jun 15, 2009
Posts: 60
You must use JavaFX Script and Java to develop JavaFX applications. There is no support for Groovy.
Dragan Stankovic
Ranch Hand

Joined: Oct 14, 2008
Posts: 33
Maybe I didn't put it clear in my question but I actually thought of some kind of combination similar to:

http://www.jroller.com/aalmiray/entry/another_look_at_fxbuilder_griffon

or

http://canoo.com/blog/2009/06/04/dierks-talk-at-j1-javafx-groovy-beauty-productivity/

Do you find these as good combination or you think that JavaFx is better when used without combining with Groovy or Griffon?

Eric Bruno
author
Ranch Hand

Joined: Jun 15, 2009
Posts: 60
The article is about calling code that is written in Groovy from a JavaFX application. This can be done, I suppose, since it's based on Java. I don't know a lot about Groovy or anything about Griffon. In general I'm an advocate of using the right language/platform for the job. If you want to call some Groovy code from your JavaFX application and it works well, then that's acceptable in my opinion.
Dragan Stankovic
Ranch Hand

Joined: Oct 14, 2008
Posts: 33
Thanks!
Jim Clarke
author
Ranch Hand

Joined: Jun 15, 2009
Posts: 49
I worked in Groovy prior to focusing on JavaFX. Groovy has some neat syntax for handling XML, etc. but I think JavaFX will eventually provide the same functionality. Because JavaFX is built on top of Java, you can call any Java object method. There are some rules for this that are outlined in the book.

With that said, I agree with Eric, in using the right tools for the right job. If Groovy makes it easier to do some piece of work, then go for it. I would caution though, the mixing Groovy Swing classes with JavaFX might be difficult, and it is not portable to the other platforms, namely mobile and TV.
Burk Hufnagel
Ranch Hand

Joined: Oct 01, 2001
Posts: 814
    
    3
Dragan Stankovic wrote:Maybe I didn't put it clear in my question but I actually thought of some kind of combination similar to:

http://www.jroller.com/aalmiray/entry/another_look_at_fxbuilder_griffon

or

http://canoo.com/blog/2009/06/04/dierks-talk-at-j1-javafx-groovy-beauty-productivity/

Do you find these as good combination or you think that JavaFx is better when used without combining with Groovy or Griffon?


Dragan,
Dierk K├Ânig of Canoo Engineering presented a talk at JavaOne titled, "JavaFX Programming Language + Groovy = Beauty + Productivity" on just this topic. It was a good talk, and he suggested using each of the languages for what they're best at: JavaFX for the User Interface, and Groovy on the server side.

The PDF is available from Sun at http://72.5.124.65/learning/javaoneonline/j1sessn.jsp?sessn=TS-3968&yr=2009&track=javase, though you probably have to join the Sun Developer Network (it's free) to get it.

I hope this helps,
Burk Hufnagel

SCJP, SCJD, SCEA 5 "Any sufficiently analyzed magic is indistinguishable from science!" Agatha Heterodyne (Girl Genius)
 
GeeCON Prague 2014
 
subject: Would you recommend using Groovy for writting Java Fx applications?