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

Trackback URL: http://blogs.sun.com/geertjan/entry/the_youtube_of_java_sample
Comments:

Stupendo!

Posted by Rohan Ranade on June 01, 2007 at 12:17 PM PDT #

This launcher is a moderately useful extension, though there are many basic coder-acceleration features in NetBeans first. I wonder if the NB team look at Intellij at all; I guess not though. There are literally dozens of small usability features that make it a real pleasure to use. The Sun Studio team do reference Intellij, ask them what features they would like to see added to NB. Or better yet, ask NB users!

Posted by Colm Smyth on June 01, 2007 at 12:48 PM PDT #

Hi Rohan, thanks for the comment, I agree.

Hi Colm, have you tried NetBeans IDE 6.0 development builds? It doesn't sound like it.

Posted by Geertjan on June 01, 2007 at 12:52 PM PDT #

This is great! I only wish NetBeans would start faster (e.g. like Glassfish v3 :), then it would be ubercool.

Posted by Roman Strobl on June 01, 2007 at 01:27 PM PDT #

Great use of JWS.

Posted by Kedar Mhaswade on June 01, 2007 at 07:08 PM PDT #

Is it a bug? if the IDE is already open, then the project does not

Posted by Kedar Mhaswade on June 01, 2007 at 07:13 PM PDT #

Java WebStart has been around for quite a while. So the technology has not been used by NetBeans only. Nice they have, though it may create a bit of confusion how to provide useful extensions to NetBeans. There have always been Plugins/Modules, but it looks like they never caught enough attention...?

Posted by Werner Keil on June 03, 2007 at 05:11 AM PDT #

Werner, not sure what you're talking about, to be honest. What does Java WebStart have to do with extensions to NetBeans? If you want to create extensions to NetBeans, there's a brand new book (here), there are dozens of tutorials (here), and there's a plugin portal (here).

Posted by Geertjan on June 03, 2007 at 11:15 AM PDT #

Very cool feature.

I think it would be great if they took it one step further and let you add these projects as entries to your File -> New Project... area in NetBeans.

Something like this:

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

Posted by Joshua Smith on June 05, 2007 at 06:39 AM PDT #

thanks for the netbeans updated versions.

Posted by dibakar debnath on June 07, 2007 at 12:06 AM PDT #

Post a Comment:

Name:
E-Mail:
URL:

Your Comment:

HTML Syntax: NOT allowed