Download NetBeans!

20070601 Friday June 01, 2007

The YouTube of Java Sample Code

There's a cool new thing in NetBeans land. A new way of distributing your applications... make a link to a ZIP containing your application available and when someone clicks the link, NetBeans IDE opens, displaying the unzipped application in the Projects window. Try it. Click this link and you'll open the Anagram Game, via my blog:

http://www.netbeans.info/services/openproject.jnlp?projecturl=http://blogs.sun.com/geertjan/resource/AnagramGame.zip

When you click the above link, you see various Java WebStart dialogs, then (if it isn't started) NetBeans IDE starts, the application is unzipped to a tmp folder, and is opened in the IDE.

All the info, with various additional settings: HowToOpenNetBeansProjectFromWebInIDE

Pretty quick and powerful way of distributing samples, which is why the above document compares it to a YouTube experience. You just slap the sample together, make the link available, and then anyone anywhere can click the link to open the application in their IDE. Simple and effective.

Personally, though, I prefer distributing samples as project templates in NetBeans modules because, that way, they're installed in the New Project wizard and the user can recreate it whenever they want. Because that's what happens when you're getting to grips with a sample, you tend to mess things up and then you need to quickly access the sample again, in pristine condition. Having it available in the New Project wizard is ideal, because then you don't even need to be on-line, while with the new approach, you need to make use of Java WebStart which implies that you're on-line in the first place.

However, aside from this point (which takes a lot more work than the new "YouTube" approach), I think that this new functionality is really cool. It is supported from NetBeans IDE 5.5.1 onwards.

Jun 01 2007, 09:52:20 AM PDT Permalink