Skip to content

Rough Book

random musings

Menu
  • About Me
  • Contact
  • Projects
    • bAdkOde
    • CherryBlossom
    • FXCalendar
    • Sulekha
Menu

JavaFX: The New Hotness

Posted on August 24, 2008September 9, 2009 by vivin

I went to JavaOne a few months ago. It was a pretty neat experience and I learnt a lot of cool things. One of the things Sun was touting was the JavaFX family of technologies. It allows you to create RIA (Rich Internet Applications) using JavaFX Script, a domain-specific language built on top of Java. The demos were pretty impressive and it looks like Sun's answer to Flash and Silverlight. I went to a few JavaFX sessions and I signed up for the preview SDK, which came out a few weeks ago. Since then, I've been playing around with the language to see what it can do. The language is pretty neat and being dynamic, has some pretty cool features like closures, list comprehension, lazy/incremental evaluation (through binding), and triggers. In addition, it uses a declarative model (although you can still use the traditional model) for describing a GUI. The API provides Swing components, but I believe the intent is to completely move away from that and use only JavaFX GUI components.

Calendar widget

Using a language that is only in preview is pretty interesting. The API is unfinished and the language isn't completely mature, but this is to be expected. That being said, it still looks promising and seems to be a very capable and expressive language. Also, seeing as it is built on top of Java, you have access to all of Java's rich API in addition to the numerous third-party Java libraries and API's that are out there. I've been playing around with it for the last week or so and I was able to write a small calendar widget. It simply shows a month view for the current month, with the current date highlighted. I haven't had much experience with writing GUIs in Java, so it took me a while to figure it all out. I shamelessly stole the colour gradient background from one of the demos in the preview SDK. The only issue I have right now is the load-time of the widget. It seems to take a while when you load it first. I don't know if it has to do with the way I coded it or not. I'm pretty sure I'm not doing it the best way, but I expect to get better once I get more familiar with the language.

Here's a screenshot of the widget running on Firefox 3 on my Ubuntu laptop (the theme is a Leopard theme):

Calendar widget

I have more details on the project page.

3 thoughts on “JavaFX: The New Hotness”

  1. sheehan says:
    September 12, 2008 at 1:30 pm

    i haven’t gotten a chance to mess with JavaFX but how is the load time of the application? One thing I never liked about Java is how heavily the VM taxes your resources. Performance and usability is key when it comes to client-side applications…does it promise?

    Reply
  2. vivin says:
    September 15, 2008 at 8:21 am

    Sheehan,

    The load time on the application is pretty high right now. To run a simple application you have to download a series of jars (mainly javafx jars). I assume this is because the whole language is still in preview (the language reference itself is still in draft). I would think that they will be ironing out these issues once the actual release comes out. Well, I’d go so far as saying that they will have to address the load-times if they want to compete with Flash or Silverlight.

    It’s true that the VM uses a bunch of resources but I think with processor speed and memory being where they’re at today, it really isn’t much of an issue. A lot of people say Java is ten times slower than C. But then C is ten times slower than assembly. So far, I would say performance is probably on par with regular Java (javafx is compiled into Java bytecode), but the load-times aren’t all that great. In spite of all this, I would still say that JavaFX looks pretty promising.

    Reply
  3. Harischandra says:
    August 6, 2009 at 4:37 am

    Very simple and effective example.

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Archives

  • February 2023
  • April 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • September 2019
  • August 2019
  • July 2019
  • June 2019
  • May 2019
  • March 2019
  • February 2019
  • January 2019
  • December 2018
  • November 2018
  • September 2018
  • August 2018
  • July 2018
  • June 2018
  • May 2018
  • April 2018
  • March 2018
  • February 2018
  • January 2018
  • December 2017
  • November 2017
  • October 2017
  • June 2017
  • March 2017
  • November 2016
  • August 2016
  • July 2016
  • June 2016
  • February 2016
  • August 2015
  • July 2014
  • June 2014
  • March 2014
  • December 2013
  • November 2013
  • September 2013
  • July 2013
  • June 2013
  • March 2013
  • February 2013
  • January 2013
  • October 2012
  • July 2012
  • June 2012
  • January 2012
  • December 2011
  • November 2011
  • October 2011
  • September 2011
  • July 2011
  • June 2011
  • May 2011
  • February 2011
  • January 2011
  • December 2010
  • November 2010
  • October 2010
  • September 2010
  • July 2010
  • June 2010
  • May 2010
  • April 2010
  • March 2010
  • January 2010
  • December 2009
  • November 2009
  • October 2009
  • September 2009
  • August 2009
  • July 2009
  • May 2009
  • April 2009
  • March 2009
  • February 2009
  • January 2009
  • December 2008
  • November 2008
  • October 2008
  • August 2008
  • March 2008
  • February 2008
  • November 2007
  • July 2007
  • June 2007
  • May 2007
  • March 2007
  • December 2006
  • October 2006
  • September 2006
  • August 2006
  • June 2006
  • April 2006
  • March 2006
  • January 2006
  • December 2005
  • November 2005
  • October 2005
  • September 2005
  • August 2005
  • July 2005
  • June 2005
  • May 2005
  • April 2005
  • February 2005
  • October 2004
  • September 2004
  • August 2004
  • July 2004
  • June 2004
  • May 2004
  • April 2004
  • March 2004
  • February 2004
  • January 2004
  • December 2003
  • November 2003
  • October 2003
  • September 2003
  • July 2003
  • June 2003
  • May 2003
  • March 2003
  • February 2003
  • January 2003
  • December 2002
  • November 2002
  • October 2002
  • September 2002
  • August 2002
  • July 2002
  • June 2002
  • May 2002
  • April 2002
  • February 2002
  • September 2001
  • August 2001
  • April 2001
  • March 2001
  • February 2001
  • January 2001
  • December 2000
  • November 2000
  • October 2000
  • August 2000
  • July 2000
  • June 2000
  • May 2000
  • March 2000
  • January 2000
  • December 1999
  • November 1999
  • October 1999
  • September 1999
©2023 Rough Book | Built using WordPress and Responsive Blogily theme by Superb
All original content on these pages is fingerprinted and certified by Digiprove