JavaFX + Oracle

A while ago the javaposse opened up a system where we could post questions. A couple of episodes ago they started going through these items. Unfortunately my question didn’t get raised. Reason being that my question got more negative votes then positive votes.

If I look back now, it actually deserved this. My question went something like : “Why did Sun created JavaFX, Flex already plays nicely with Java, why not invent a Java to ActionScript compiler.” (somewhat like gwt but then ActionScript output). Now that Sun got bought by Oracle I’m pretty sure, JavaFX will succeed. At least if Oracle will put their money where their mought is. (Larry Ellison publicly announced his support for JavaFX). Why do I think this will have a big impact on the success of JavaFX. Well pretty simple, take a look at JSF. Oracle was one of the driving forces behind this. There still is room for improvement (isn’t there always). But it’s already a nice framework for building data centric applications.
If you now take a look at the new version ADF 11 and their JSF comonents. Well I haven’t seen many JFS components that are better. I have to admit, I myself am more in favor of none component based frameworks (they tend to be more flexible).
To come back to JavaFX. Currently we still don’t have a DataGrid or something. This is still a big issue, I feel somewhat like when Microsoft first released Silverlight 1. It was nice but not yet usefull. However in the near future I foresee that Oracle will finalize the basic JavaFX components and publish a nice basic DataGrid that will be on par with the Flex Grid(s).

And if all goes well, we should finally see a real Java(FX) component market happening. That’s something I still don’t understand. Flex was way ahead of Silverlight with their framework and wigdets. I recently wanted to compare them again. What struck me was the component market for Silverlight. I already have big players providing very datacentric and rich gui widgets for sale. For Flex I only found Ilog as big player there. I’m still looking for a DataGrid with very powerfull sorting,grouping,… basic stuff. In Silverlight these are already in production (have a look at For Flex I’m still searching.

As Java is a much more programming driven environment I think these components will show up much faster and probably also in the opensource world. This in my opinion is the big problem of Flex. The framework and language is good enough to do this, but the most guys who know Actionscript have a design background and not a background in enterprise/component development. I really hope Oracle/Sun will release there version 2 really soon so we can see this happening. I’m actually really looking forward to the next couple of years in the Java eco system. We already have a wealth of opensource tools for doing enterprise development (starting from IDE’s,building systems,continuous integaration,testing environmonts,…) if we then would also get a good framework for doing rich gui’s that work perfectly on all platforms (even Linux, still my prefered one) … What does a developer want more?

Groovy and Grails

Rails has got a lot of buzz the last couple of years. I myself have investigated it, didn’t write any apps but it looked nice indeed. I wonder why grails doesn’t have this much attention yet. I have read the a couple books on groovy and grails and started my own small project. I have to say I like it, the thing I probably like the most is that you can package it as a standard war file and just deloy it. Another great thing is the fact that you can reuse all the big java libraries that have been released. So you create your reports in Jasper or Birt and just call them from your grails application.

I wonder how they solved this issue in rails. I can hardly imagine they rewrote entire libraries? (maybe they didn’t solve it yet).

Any grails users out there? Any good user groups in Belgium?

Flex update

I had a nice discussion with TimothyP I agreed on most of his points that Silverlight is indeed a nice framework (as is XAML as a language,standard,…). This evening I was doing some more Flex development and I noticed that I had forgotten to mention one thing. Maybe ActionScript is weakly typed, but the Flex Builder tool allows you to have code completion as if it was a strongly typed language.

You could compare it to VB.NET as there you also have code completion but are allowed to call functions that aren’t visible. (sometimes handy when you’re dealing with an ActiveX and don’t want to dependent on the version)

I’ll put some screenshots and code in the near future. Now I’m wrestling with a deadline 🙂

BTW Timothy sorry for the many spelling mistakes. I don’t want to lose time with writing stuff and normally correct it when I’ve published it, but seems there’s no way to edit a comment ?

Flex VS Silverlight

These days everybody in the web world is pushing RIA’s. We have the javascript frameworks like Scriptacilous,Dojo,GWT,… , we also have the browser plugin options like Silverlight,Flex,JavaFX. Probably I’m forgetting some here, but these are the ones I’m following.

As I worked with most of them (some more then others) my preference more and more leans to Flex for developing Web applications.


Well there are several reasons but probably one of the biggest reasons is the fact that Adobe has been releasing a lot of there core frameworks opensource. The Flex core is opensource, they recently released BlazeDS a Java framework for communicating in their own binary format with a Flash application.
For now the development platform (Flex Builder) still has to be bought, but if you want you can just use an Ant script to compile it.

Another big reason is the fact that Flash runs on Windows,Mac and Linux. Even the tool Flex Builder runs on those 3 OS’.

The fact that Flex can display a couple of thousand records in a Datagrid without crashing my browser is also nice. Try doing that with javascript (although I’ve seen a demo of a Dojo Datagrid displaying 100.000 records) but in most frameworks it just hangs your browser.

JavaFX is still in a early stage and IMHO is too little to late!

Microsoft offcourse is pushing their new Silverlight. I’ve seen some demo’s went to some workshops. And I have to admit it’s not bad but if you compare it to Flex, well hmm I’m not sure but they sure seem to be far behind. I just tried the tool Deep zoom (this was shown on mix 2008 as showcase for Silverlight 2) and I’m not really impressed. Compare it to this tool that was shown on Javapolis 2007 and you’ll see where I’m heading 🙂
On the other side Microsoft has the benefit that a Silverlight application can be written in the same language from Gui to backend. But I’m not sure if that’s really such a major advantage. If I look at friends and collegeaus they all seem to be doing some animation stuff with Flash for their customers. And most of them do it in Macromedia Flash MX. They also write code in there, the language is called ActionScript and is a real object oriented language. But these guys don’t know to much about building a large scale application. They do know however to write a nice Gui interface. So they can write components that can be used in Flex. So there Adobe also has a big advantage as they pretty much own the Graphics industry 🙂

One thing that most peeple however seem to overlook is the fact that with all these RIA applications the search engines will index much less of your page. If you for example have product catalog made with Flex,Silverlight or with one of the Javascript toolkits I’m not sure that they will be indexed by the spiders. But then again you can workaround this and always generate a Sitemap of your product catalog in plain Html. Hmm I wonder how many companies do that and how much money has been lost by companies who didn’t show up on top in a search engine because of this.
Another thing is that integration using links and parameters also gets a lot more complicated!

As I’m working with Flex at the moment you’ll here some more in the future.

PS I hope the upgrade of wordpress worked. Now I’m on 2.3.3 (currently latest stable release) If more SPAM should appear please notify me ASAP!!

Dojo 1.0 + OCR

This week Dojo 1.0 was released. I already took a quick look at it, and it looks really nice. Big changes since the last version I used (0.4). The new grid is awesome, I really hope it will be easy to use but I’m pretty sure it will be. The guys from the Dojo community are really good programmers. I spent some timing digging through the code for a fix, I saw several things I didn’t even know were possible with Javascript 🙂
I’ll come back on Dojo once I’ve got some real first hand experience with it, but it looks promising (and also much faster than previous releases)
I already found out that if you pass in a JSON store to your grid, your identifier better be unique or it won’t work (took me some time to figure that one out 🙂 )

A couple of weeks ago We bought a All in one (scanner,fax,printer,copier). The nice thing about this device it let’s you scan 50 pages (document feeder) without having to put every page on the scanner window. That combined with the ability to scan to a networkdrive,email or ftp server makes this device the perfect solution for my administrative problem. My goal is to go to a paperless office but it will take some time until we get there.
Problem is the device scans the images straight to PDF. So text actually becomes an image, you can’t select it, search for text,… it’s not yet what I want. In my Ubuntu I searched for OCR and got some results witch I installed. Almost all of the tools let me scan for text in the PDF, when I saved the document I suddenly could search for text in the document. Still the selecting of text wasn’t possible. Philip told me that Google had a solution that let’s you convert these kind of documents to XHtml. I knew they were developing an OCR tool but didn’t know it would be able to do this kind of stuff. I tried to install it but I’m still missing some dependecies, I’ll try it later again.

Streaming media -> youtube style

Wouldn’t it be nice to create your own youtube movies and host them on your own private server? Why you ask, well maybe it’s content you don’t want others to view. Prolly this can be done using youtube, but hey I have my own servers and I want it where I have full access! (as do many companies actually).

So how do you do this using opensource tools? Actually very, very simple

I started from this blog entry. But as I’m using ubuntu dapper, I have the nice debian apt tool 🙂

So in short here is what you do:

apt-get install mencoder
apt-get install ruby
apt-get install flvtool2

And I had my tools install (maybe you need some extra depencies here) don’t know actually.
Then the commands like in the previous posts

mencoder \
orig_file.ext \
-ofps 25 \
-o dest_file.flv \
-of lavf \
-oac mp3lame \
-lameopts abr:br=64 \
-srate 22050 \
-ovc lavc \
-lavfopts i_certify_that_my_video_stream_does_not_use_b_frames \
-lavcopts vcodec=flv:keyint=50:vbitrate=300:mbd=2:mv0:trell:\
v4mv:cbp:last_pred=3 -vop scale=320:240


flvtool2 -UP dest_file.flv

And you have your indexed flash movie. And may I note the importance of the indexed in the sentence once more. In the past I tried this with a long avi and believe me its no fun if you can’t forward or rewind!!

So then you put the flv file on your server. Now all you need is a flash movie player for playing your content. And I like the flowplayer. You download it, setup a small page like this

<object type="application/x-shockwave-flash" data="FlowPlayer.swf"
width="320" height="263" id="FlowPlayer">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="FlowPlayer.swf" />
<param name="quality" value="high" />
<param name="scale" value="noScale" />
<param name="wmode" value="transparent" />
<param name="flashvars" value="videoFile=dest_file.flv"/>

Et voila, you have your own streaming video. Now put it into a web application and you have your own streaming media center!!


Dojo patch rejected :(

I’m using the dojo dropdowndatepicker in a lot of my projects. Problem with this widget is that it only really supports the yyyy-mm-dd notation (as the standard is). But all the applications I develop the people want our local notation (dd-mm-yyyy). So I wrote a small fix that helps. Too bad it got rejected as it doesn’t fit in the idea of the project and the new widget set they are building.

For now it’ll be a patch I have to apply on all my dojo downloads to get the functionality I need from it. And let’s hope in the future we will migrate our code to the iso standards, right?


In one of my projects the user has to select a customer from a dropdown list. Problem is that the number of customers they have is much to big to prefill. So I used dwr to build a solution. The user has a dropdown from which he can choose the field he wants to query (let’s say street), he than fills in a streetname, presses the button and the list gets prefilled with the list of customers who match.

How does it work. Wel really simple 🙂

In my backend I have a simple POJO Search with a method getCustomers(String searchField,String searchValue). This calls a service layer, who in turn calls a dao layer,… you know the drill. In the end the method will return a List of Customer objects. I exposed these objects in the dwr.xml configuration file. (that’s it for the java backend stuff) (nice isn’t it 🙂 )

Now the javascript part is also small and handy. I had to include the dwr engine and my exposed object as javascript objects. When the user presses the button this small piece of code gets executed


When the javascript gets a response back, the CustomerCallBackHandler will be executed. That looks like this

function CustomerCallBackHandler(data){

Where data is an array of Customer JSON objects. This means that in my java Customer object I have the getter/setter getId(),getName(). In javascript I can simply do data[0].id and data[0].name.

Now isn’t that nifty?! 😛

/me like

Most important setting when using Dojo

In our current application we use dojo. Only for a small amount of the application at this moment, but for the new version we are planning to include a lot more functionality using the dojo toolkit. I was testing this on an older machine (p3 1Gig) and the application took really long to display the page. So I asked around on irc #dojo and they pointed me to this really nice setting:

<script type="text/javascript">
	djConfig = {
		parseWidgets: false

Dojo waits until page has loaded and then starts scanning for the dojoType attributes, you can imagine if you have a lot of data this will take a while. With this simple setting you tell dojo don’t do this.
Then for every dojo widget you want to use, just add

<script> dojo.hostenv.searchIds.push(id)</script>

Dojo keeps all the ids and only tries to create a widget out of the ones you push out. So no page analysis afterwards.

Sweet 2