• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Would you recommend using Groovy for writting Java Fx applications?

 
Dragan Stankovic
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Eric Bruno
author
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You must use JavaFX Script and Java to develop JavaFX applications. There is no support for Groovy.
 
Dragan Stankovic
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks!
 
Jim Clarke
author
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 814
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic