20 Sep 2010

Read about JavaFX 1.2, port to 1.3, know about 2.0

As I mentioned in my last post I was asked to review JavaFX 1.2 Application Development Cookbook. Since JavaFX 1.2 is quite old I decided to use 1.3 and port code found in book along the way. Until chapter 4 which is about components and skinning in JavaFX I hadn't any big obstacles. I was hitting Shift+F6 in NetBeans and everything was running fine. First recipe FormDemo of fourth chapter failed to run due to some compile error in Deck class which wasn't even used in FormDemo (I hadn't got time to dig why this is happening) so I decided to port this custom control to 1.3. Below is code that gave me a chance to learn something new about creating controls in JavaFX.

override function create():Node {
        stack.effect = if(enableReflection)Reflection{fraction:0.35} else null;

I knew this is the way you created CustomNode in JavaFX, but Control would have to be a different beast. Its online documentation doesn't tell anything about extending. Searching gave me some interesting information on JavaFX forum and I was directed to CustomNode doc which says, that overriding create function is the way of dinosaurs. Now one should override children variable.

JavaONE 2010


And all the above and all the work done by author of the mentioned book and numerous people working on JavaFX Script libraries, components, books, sessions and docs will become deprecated in a year, because Oracle decided to drop JavaFX Script from JavaFX 2.0 release. Instead you will be able to write against JavaFX libraries in Scala, Groovy, Jython, JRuby and plain old Java and there will be WebPane at last. It's a shame JavaFX Script is going to go out of JavaFX platform, but I guess it didn't see a lot adoption, developers wanted more integration with their favorite languages and Oracle being very pragmatic decided there's no point in pushing new language. I felt something was wrong with Tor Norby when listening to JavaPosse and now I know why. I don't think Oracle will tell a word about JavaFX Authoring Tool. There's no need for such a tool in corporate environment. I haven't heard anything about Mobile either, so I guess there's no future for JavaFX Mobile, too. I also wonder what will happen to JavaFX Production Suite, since it produced FXZ files, that were JavaFX Script files zipped. There's also JavaFX Composer affected by depracating FX Script. I'd like to see JavaFX Script being like FXG in Flex 4.

I'm sad that JavaFX Script is going away. I really like the ease of literal objects creation, binding, animation syntax. Maybe it will be fully open sourced (yeah, I know it's Oracle, but I can dream, right?) someone will pick it up and make it as yet another language running on JVM?

Anyway, Oracle is really strengthening Java in RIA space. Especially opening JavaFX libraries to other languages and creating WebPane are great moves.

15 Sep 2010

How is JavaFX's outlook now

JavaFX's main strength often touted is that it's cross-platform. "See JavaFX play on all the screens of your life" is direct quote from JavaFX's website. Java now is cross-platform on computers, but mobile JavaME is different version in many aspects (libraries, language level stuck at 1.3), then there's also BD-J, Java for Blue Ray players which has it's own set of libraries. And there's Java Card All of them don't even share same level of Java the language, let alone libraries and tools. JavaFX aims at gathering again those target platforms to WORA mantra with common profile which omits for example javafx.ext.swing package and for good reasons - nobody wants to drag that ball and chain into their revolutionary mobile device, right? The three screens would be your iPad, iPhone, AppleTV, err... Sorry I've meant your TV, Windows computer (preferably, because JavaFX is best supported on Windows) and Windows Mobile 6.5 phone.

The problem is JavaFX is available only on desktop: yeah, there was one or two TV shown on stage last year at JavaONE, but I doubt JavaFX TV will survive. Putting Youtube and other Internet sources of content on TV makes sense, but apps? We'll see soon with Google TV, but again it is separate box. TVs are for audio and video output, period.

Where will JavaFX find its home on the smallest of the screens? Windows Mobile? Yeah, right. I used future tense so that doesn't count. Maybe Windows Phone 7? It should be released with some powerful hardware that surely would easily cope with animations, effects and all the richness you can imagine. No. Two words: Microsoft Silverlight.

Symbian or Meego? This would be a pleasant surprise (and big surprise regarding Meego). I know that Nokia is still working on Symbian's Java runtime, but I haven't seen anything about JavaFX Mobile implementation. There's possibility. And there's Nokia's contender in space: Qt Quick.

Blackberry is possible too. Not very exciting platform yet it is doing quite well in US market and in segment that is of interest for Oracle. Still there's no word about JavaFX landing on RIM's handsets.

Anyway Blackberry is going to be crushed by almighty army of Android devices which will rule the world in short order. So let's put JavaFX on Android. It's open, it's free and it's being sued.

Let's summarize. JavaFX is nice on desktop, almost non existent on TV. There's beta JavaFX Mobile implementation for Windows Mobile (one phone, HTC Touch Diamond) as for others: Blackberry: no, no info on future introduction. iPhone: nope. Windows Phone 7: Microsoft Silverlight. Symbian: maybe, there's Flash Lite, there's Silverlight, there will be Qt Quick soon. Big opportunity to compete. MeeGo: would be surprising, Qt Quick will be there soon. Android: now that Oracle sued Google over VM technology I don't see JavaFX on it.

I really like JavaFX and certainly would like to see it on my mobile (Symbian based). We'll see what future holds. 

6 Sep 2010

Quite a surprise for me

I've decided to break the silence, because something really nice happened to me. A few day ago I were contacted by Packt Publishing to write a review of book: JavaFX 1.2 Application Development Cookbook. I agreed to do it. Although now JavaFX is at 1.3.1 and there were some breaking changes (that you can read about in JavaFX 1.2 to 1.3 migration guide) I hope to find that book informative.