Friday Aug 31, 2012

Terramenta YouTube Videos

On, you'll find some very cool videos about Terramenta, which can be downloaded here:

Here's two of the videos:

Congrats to the Terramenta team for these great intro videos. I'm looking forward to seeing one on how to create plugins for Terramenta!

Thursday Aug 30, 2012

Live from Amsterdam: #netbeans irc channel on FreeNode

Here we, Ralph and I, from the NetBeans Team, are again in Cafe Stevens in Amsterdam, ready to answer your NetBeans-related questions at #netbeans on FreeNode!

We'll be around live on the #netbeans irc channel on FreeNode for the next hour or so!

Wednesday Aug 29, 2012

Baseline for GIS Applications

The application I introduced here yesterday can best be understood via its author's explanation: "As I developed several different WorldWind-based applications, I noticed that they all started out the same. Terramenta was born so I wouldn't have to recreate the baseline every time, I could just provide NetBeans plugin modules to introduce the new features required by different projects."

So, to try it out for myself, I checked out the sources from the Mercurial repo today, built them, and ran them.

hg clone

On Windows, things worked fine, on Ubuntu they didn't because the relevant native libraries aren't provided yet out of the box.

Here's the result:

The above provides the WorldWind globe, together with all the standard options, e.g., for showing names and other WorldWind features, together with several features that I don't understand yet, such as tools for creating shapes and a recorder for replaying sequences.

The complete application is like this, i.e., one single functionality module is provided, which exposes several API packages that can be extended:

It would really be cool if the above module could also be added to a Maven-based application via a reference to a Maven repository, in the way that Timon Veenstra and the AgroSense team have made available their GeoViewer.

One cool thing from the GeoViewer solution is the Flamingo menubar, which I added to Terramenta by simply putting the dependency below into the application POM:


The result, without doing anything other than the above:

I am looking forward to helping to document the use cases and developer scenarios for Terramenta! Something like this, created by Timon to demonstrate the GeoViewer use case would be cool to have:

Monday Aug 27, 2012

Dependency Scanning Switch

The dependency scanning switch is switched on by default. Its description is clear, in the Options window where it can be switched on/off:

Sunday Aug 26, 2012

IRC News from #netbeans on FreeNode

I joined the #netbeans channel on FreeNode last week and the discussions there are really great. It's so cool to not have the endless back and forth of an e-mail exchange. Instead, you can hammer out a complete solution to a problem while chatting live in the channel.

A case in point was yesterday, when someone named 'charmeleon' wanted to create a NetBeans Platform based application that includes the "image" module from the NetBeans IDE sources. That way, he'd have a starting point for his own image-oriented application, since he'd not only have the NetBeans Platform, but also the sources of the "image" module.

Had we been communicating via e-mail, it would have taken weeks, at least, to come to a solution. Instead, we hashed it out together live, including some very specific problems that would have been hard to communicate about via e-mail.

In the end, I made a movie showing exactly the scenario that charmeleon was interested in:

And, right now, in the #netbeans channel, charmeleon said: "NetBeans RCP feels like cheating once you start getting over the hump." I'm sure the fact that the hump was handled within a few hours of chatting on irc is a big contributor to that impression.

Saturday Aug 25, 2012

NetBeans in Ubuntu News

Friday Aug 24, 2012

YouTube: Super Hidden NetBeans Features (Part 2)

Also see part 1.

Thursday Aug 23, 2012

#netbeans irc channel on FreeNode

Wednesday Aug 22, 2012

First Look @ NetBeans Clipboard History

Tried out the latest jet-main build today:

And, guess what, Ctrl-Alt-V provides access to multiple clipboards, very useful:

Note that this is not in NetBeans IDE 7.2, but in very recent builds for the next version of NetBeans IDE. When any of the numbers in the clipboard history is pressed on the keyboard, the related text in the clipboard is inserted at the cursor. Alternatively, scroll up and down with the arrow keys.

Tuesday Aug 21, 2012

Propylon on NetBeans Platform @ NASCIO Award Finalists

Two really cool Java applications created by Propylon in the legislative domain, KLISS and Legend, are finalists for the NASCIO 2012 Recognition Awards this year. NASCIO represents state chief information officers and information technology executives and managers from state governments across the United States. 

KLISS is the legislative system used by the Kansas Legislature, while Legend is used by the North Dakota Legislature. Other legislatures also use Propylon software, while still others are scheduled to begin using Propylon solutions in the coming period.

Some Tweets making the happy announcement in the last few days, one by Sean McGrath, Propylon CTO, and the other by Sam Brownback, the governor of Kansas:

Anyone who's been following this blog for a while will not be surprised at the general appearance of the desktop client that is part of the KLISS and Legend solutions:

Indeed, these both are NetBeans Platform applications, just like all of these:

An earlier article on the NetBeans Platform in the context of Propylon software can be found here:

Congratulations to the Propylon team!

Monday Aug 20, 2012

Open File Action

Let's create a simple NetBeans Platform application for opening files. We assume we need an "Open File" action, rather than using the Favorites window to open files, which would work just as well, if not better.

  1. Use the NetBeans Platform Application template in the New Project dialog to create a skeleton NetBeans Platform application.

  2. Add a new module and set dependencies on Datasystems API, File System API, Lookup API, Nodes API, UI Utilities API, and Utilities API.

  3. In the new module, define the class below:
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import org.openide.awt.ActionID;
    import org.openide.awt.ActionReference;
    import org.openide.awt.ActionRegistration;
    import org.openide.cookies.OpenCookie;
    import org.openide.filesystems.FileChooserBuilder;
    import org.openide.filesystems.FileUtil;
    import org.openide.loaders.DataObject;
    import org.openide.loaders.DataObjectNotFoundException;
    import org.openide.util.Exceptions;
    import org.openide.util.NbBundle.Messages;
    @ActionID(category = "File", id = "org.mycore.OpenFileAction")
    @ActionRegistration(displayName = "#CTL_OpenFileAction")
    @ActionReference(path = "Menu/File", position = 10)
    @Messages("CTL_OpenFileAction=Open File")
    public final class OpenFileAction implements ActionListener {
        public void actionPerformed(ActionEvent e) {
            //The default dir to use if no value is stored
            File home = new File(System.getProperty("user.home"));
            //Now build a file chooser and invoke the dialog in one line of code
            //"user-dir" is our unique key
            File toAdd = new FileChooserBuilder("user-dir").setTitle("Open File").
            //Result will be null if the user clicked cancel or closed the dialog w/o OK
            if (toAdd != null) {
                try {
                } catch (DataObjectNotFoundException ex) {
  4. Add the "image" module, which is in the "ide" cluster, in the Libraries tab of the application's Project Properties dialog.

Run the application. Choose File | Open File and then browse on disk to the files of your choice. Depending on whether you have support for the related file type, e.g., you're able to open image files because of the "image" module added above, the file will open in the application's editor mode.

Read this related blog entry for a different approach!

Sunday Aug 19, 2012

Ruby in NetBeans IDE 7.2

I've not so far managed to get commit access to the Ruby community plugin repo, so here are instructions for upgrading it to 7.2 for someone who does have the rights to do so.

Note: For those who don't care about the gory details, i.e., who simply want to use Ruby in NetBeans IDE 7.2, go to the Plugin Manager in NetBeans IDE 7.2, and register  as a new update center. Though the update center is, as you can see, in this blog, the NBMs that will be available once you've registered the update center are located at

  1. Check out the community Ruby plugin:

  2.  Open the Ruby plugin project:

  3. Build the project. This takes a while because many NetBeans modules in NBM format need to be downloaded. While you wait, read issue 210334, which describes the reason why the plugin will not work out of the box in 7.2, after which you should read, which shows how other plugins in NetBeans IDE needed to be changed because of issue 210334.

  4. At some stage in your life, the NBMs will be downloaded and the compilation process will throw up this error, which makes complete sense, once you've read the issue referred to in the previous step:
    No dependent module
  5. Now we're going to tweak the plugin here and there so that we're not depending on the dead "" (hereafter referred to as "the WCTA", for "the Web Client Tools API") module anymore, as well as few other tweaks that turned out to be needed for 7.2.
    • Open "Ruby on Rails Project Support". In the Important Files node, open "Project Metadata". Look for the WCTA dependency and delete it. Open "RailsActionProvider" and delete the two import statements that come from the WCTA. Comment out the else-clause at line 629. Open "RailsUrlDisplayer" and delete the 6 import statements that come from WCTA. Comment out the if-clause at line 97. Comment out definition and usage of "LocationMapperfactory" from line 108 onwards. Remove two obsolete catch clauses at the end of the class. Now the module can be built without a problem.

    • Expand the "NB Ruby" project. Here, we're not going to change anything within a specific module. Instead, we're going to remove a module completely from the application. The module is "Ruby Test Runner", which makes use of a lot of code from "org.netbeans.modules.gsf.testrunner",  which no longer exists. I suspect that the Ruby plugin hasn't made use of this module for a long time and that, i.e., it has been dead functionality for quite some time, though I could be wrong, of course. Open the "" file in the Important Files node of the NB Ruby project. In there, on line 27, delete the reference to "ruby.testrunner". Now the module will be excluded from the build process.

    • Open "Ruby and Rails". In the Important Files node, open "Project Metadata" and remove the dependency on "org.netbeans.modules.ruby.testrunner". 

    • Open "GlassFish Server 3 - Ruby". In the "JRubyServerModule" class, two usages of a method "startServer" expect two arguments, now, instead of one. For the second argument, pass in "null" and then build the module and it will compile correctly.

Now everything compiles and you can run the Ruby plugin! And, those few tweaks don't add up to very much work, do they? Based on the changes made above, I don't think any functionality has been impacted, though, again, feel free to disagree. Have fun with the great Ruby support that the community Ruby plugin provides for NetBeans IDE 7.2!

Saturday Aug 18, 2012

Ubuntu 12.04 and NetBeans IDE

Between yesterday and today I switched from Ubuntu 11.04 (Natty Narwhal) to Ubuntu 11.10 (Oneiric Ocelot) to Ubuntu 12.04 (Precise Pangolin). For some reason I couldn't switch directly from 11.04 to 12.04, at least, I couldn't find 12.04 in the update manager of 11.04. Only once I was on 11.10 did I find 12.04 in the update manager and then, with a feeling of 'oh well, since I'm upgrading anyway, I might as well go all the way', I started the next update process shortly after finishing the first.

The one and only reason for doing so (I was generally happy with 11.04) was that Ubuntu had become increasingly sluggish. My assumption was that by upgrading I wouldn't only be gaining from the inevitable performance enhancements that new releases of any product provide, but that in the process of upgrading many corrupted files would magically be removed or fixed.

I committed the absolute cardinal sin of not backing up my disk prior to starting the upgrade process. I did so knowing that anything of importance on my disk had already been backed up to "the cloud" (e.g., repos on, incrementally, over time, and that if my disk were to get wiped out I'd be secretly happy to be rid of billions of pointless pics and documents that I'm too lazy to clean up myself. But, as luck, I guess, would have it, my entire disk with all its content remained intact through both processes.

And, after switching to Nimbus, and fiddling with the themes a bit (I installed an app called Unsettings, which turned out to be handy), NetBeans IDE looks good too. Click the image below to see NetBeans IDE fully:

Plus, via the NetBeans Ayatana plugin, I've suddenly begun to really appreciate the real estate savings thanks to integration of NetBeans IDE with the Unity menu bar:

I've browsed a little bit on-line to see what the enhancements are in 12.04. The first thing I noticed is that the Unity sidebar thing doesn't switch on/off back/forward weirdly and unexpectedly anymore, i.e., it is 100% fixed all the time, which (despite the loss of real estate) I am already happy about. This change results in a much quieter work environment, i.e., the restless on and off switching was, now that I think back to it with the fixed sidebar in the corner of my eye, quite distracting, even though I didn't realize it at the time.

I also read somewhere that dual monitor support is enhanced, which is great, maybe I'll be able to use Ubuntu again for presentations (at some stage the dual monitor thing stopped working and that was the only reason I switched to Windows, i.e., I couldn't do presentations anymore).

Aside from that, I've read that stability and performance are improved, which surely can't be a bad thing either. What I liked, too, is that I didn't need to reconfigure my wireless setup, which is what I had to do a few upgrades ago, i.e., several settings had been wiped out in the upgrade process. In contrast, so far, everything I've had before is exactly as it was before and the whole process has been seamless.

And, guess what, my laptop doesn't sound like a plane about to take off anymore. Maybe the biggest plus so far. Good job, Ubuntu!

Friday Aug 17, 2012

YouTube: Super Hidden NetBeans Features (Part 1)

The moment I completed this 5 minute YouTube movie about two very hidden NetBeans features, I realized that I could immediately think of a whole bunch of other features that are just as hidden as these, so that inevitably this is the first of a longer series, part 2 of which will be published this time next week:

Do you know of any features that are so hidden that few (if any) others could possibly know about them? Features related to drag 'n drop and command line settings are great candidates. Feel free to drop me a quick e-mail about them at geertjan dot wielenga at oracle dot com and then maybe I will use your tips in a future 'Super Hidden NetBeans Features' screencast.

Thursday Aug 16, 2012

5 Tips for Arabic Java Desktop Developers

I created this basic Java desktop infrastructure with Arabic display texts in about 15 minutes, though the RTL parts took a bit longer to get exactly right in the end, but were solved thanks to two sources discussed further down in this blog entry:

Notice that the application has a window system with undockable components, as well as a menu bar and a toolbar; all of which are pluggable because this is an example of a NetBeans Platform application, which is natively modular. Now "all" you need to do is code your business logic and you're done, since the infrastructure is ready and waiting for your domain-specific content. Consider the above as a generic template for Arabic Java desktop applications, i.e., the above application can run on Windows, Linux, Mac OSX, etc, i.e., on any operating system that supports Java SE.

Want to create the application you see above? Below are 5 tips to help you get started.

  1. Download the Arabic version of NetBeans IDE. Go to and choose Arabic in the IDE Language drop-down:

    Click Next, choose your distribution, and then click Download. You will see Arabic in the page that appears as the download starts:

  2. Don't worry about incomplete translations. Once you've downloaded and installed NetBeans IDE, take a look at the "locale" folders, which are within, for example, the "platform/modules" folder (as well as the "ide/modules" folder, for example). There you'll see that not only do you have Arabic JARs (denoted by the "ar_SA" extension), but also those for several other languages:

    Two concerns could come to the front of your mind at this point, neither of which are genuinely problems. First of all, you'll be concerned about, at the end of your application development, needing to bundle only the Arabic JARs, and not all the other ones, with your application. This blog entry, with thanks to Johan Walter, a Swedish NetBeans Platform developer, should help you out on that score. Secondly, once you've started up NetBeans IDE in Arabic (using the next step below), you might be concerned when you notice that not everything has been translated into Arabic, for example:

    But, you shouldn't be concerned about this either. Remember that the point of this exercise is to create your own Arabic application on the NetBeans Platform. As you'll see later in this blog entry, you have full control over all the texts in the NetBeans Platform, so you can change any text, throughout the NetBeans Platform, to Arabic. Therefore, the fact that NetBeans IDE itself, or even the NetBeans Platform itself, is not fully translated to Arabic really isn't a blocker to creating applications in Arabic on top of the NetBeans Platform.

  3. Set the locale of the IDE and of the application. Once you've downloaded and installed NetBeans IDE, go to the netbeans.conf file and use the "-J-Duser.language" and the "-J-Duser.region" settings, as shown below, to set the IDE to use the Arabic JARs:

    However, as noted earlier, the fact that you're creating an application in Arabic doesn't mean that the IDE itself must be set up in Arabic. You could create an Arabic application in the English NetBeans IDE, which might be the simplest way to do it. Once you've started up the IDE and you've created your new NetBeans Platform application, which is as always done via the New Project wizard, set the following in the file of the application, so that the Arabic JARs are used for the application that you're creating:

    run.args.extra=-J-Duser.language=ar -J-Duser.region=SA
  4. Use the tools in the IDE. OK. So, now we're where the rubber meets the road. Everything has been set up and now we're creating our modules and coding the application. You're going to run into several things, all of which the IDE handles very gracefully for you. Here are solutions to all the potential stumbling blocks of which I am aware:
    • Menus, toolbars, and tabs need to be right-aligned. As luck would have it, quite some research has been done in this area already. Start by reading and using Tonny Kohar's insights on RTL layout, which are great, and very important in this context. Then also take a look at this module in Git, together with the discussion in All my knowledge of RTL, as shown in the screenshot at the start of this blog entry, comes from these two sources.
    • Predefined NetBeans Platform display texts need to be translated to Arabic. Not a problem. Let's imagine you want to translate the "Window" menu to "شباك", for example. Right-click the application and choose Branding. In the Branding dialog, go to Resource Bundles, type the text you want to change, and then you'll need to read through the filtered strings intelligently to identify the one you need to change:

      Then right-click on the string you need to translate and choose Add to Branding. Then type your Arabic characters, which will then be saved in the application's 'branding' folder, in a properties file, where the entry will override the one provided by the NetBeans Platform itself.

    • New display texts need to be translated to Arabic. For example, when you create new window and new menu items, their display texts need to be Arabic. Not a problem. The NetBeans Java Editor can handle Arabic texts easily, for example, this is how the display text in the tab of a window, the tooltip in a window, and the menu item for opening the window are set, in a Java annotation that is converted to Bundle.properies entries when the file is saved:

    • The display text in the title bar needs to be translated to Arabic. Not a problem. Just right-click and choose Rename to rename the application and then use Arabic characters in the rename dialog. (Or go to the Branding dialog and use the General panel, which provides an Application Title field, where you can type Arabic characters.) That's how I ended up with this, which is what's displayed in the title bar:

  5. Download the completed sample. Want the sources of the above, i.e., the end result of all the work above? Go here, check out the application via Subversion, and open the project in NetBeans IDE 7.2:

    However, note that the IDE from which you run this application MUST include the Arabic JARs, i.e., you need to not only have NetBeans IDE 7.2, but the Arabic version of NetBeans IDE 7.2, as described in the first tip above. Note that the RTL support (i.e., the right-aligned menubar, toolbar, and tabs) is not part of the above download. Instead, refer to the sources mentioned in the previous tip if you're interested in those pieces.

Hope this is helpful to Java desktop developers wanting to create their software systems for Arabic end users. Using all the tools, components, and coding patterns provided by the NetBeans Platform is surely a lot simpler than reinventing the wheel all by yourself.

Funny Moment of the Day. Frank Caliendo is pretty clever with his impersonations, check this out on YouTube.

Wednesday Aug 15, 2012

YouTube: Get Started Creating Modular Data Analyzers in Java

Yesterday someone asked me the standard newbie question, along the lines of: "OK, cool, this NetBeans Platform thing seems pretty useful, but I don't 'get' it. How does everything fit together and how do I create an actual real application, just like one of those cool apps on the NetBeans Platform Showcase."

Well, in all honesty, there are heaps of tutorials on the NetBeans Platform Learning Trail, including end to end tutorials, i.e., including tutorials for complete applications. However, this particular user had a scenario in mind that is only partly covered in the New File Type Tutorial. He wanted to understand a scenario where (1) he should be able to manage his own file type, (2) programmatically read and write data from a file of the type, and (3) display the data in various ways in different windows.

So I created a new YouTube movie, covering about 42 minutes, which puts most of the topics above together. It's not perfect, if I'd do it again I'd change a few things, but anyway, he found it useful, so here it is:

Today I took the example a bit further. Now there are three windows in total, i.e., the editor plus two independent TopComponents, all of which are synchronized. Any change in any of these windows enables the Save action which, when invoked, saves the changes in the current window into the file, which is then pushed into the Lookup so that the other windows are updated with the new data:

What's the point of this scenario? Well, imagine that one of the windows above represents the data as colors, while one of the other windows represents the data in a chart. The key to all of that is the communication between these windows, since they come from different modules, which is what this sample illustrates. With the above knowledge, it's up to you to change the representation however you like, i.e., use JFreeChart or JavaFX or whatever. But the basis, before you get to the visualizations, is setting up the architecture, window system, and communication layer, all of which are provided by this sample.

If anyone is interested in the sources of the above, or in a part 2 of the screencast above, feel free to let me know in the comments of this blog entry.

Funny Moment of the Day. Elsewhere on YouTube, watch this hilarious clip, featuring an awesome Tom Cruise and Arnold Schwarzenegger impression:

Monday Aug 13, 2012

Back From Vacation

Back from vacation and I've found many interesting bits of news in my inbox, as well as elsewhere online, while I've been busy enough throughout today working on various things of interest worth sharing.

Here's the highlights in random order.

  • NetBeans Day at JavaOne 2012. NetBeans Day on 30 September is going to be unlike anything anyone has ever seen before, i.e., truly awesome. Very many speakers will be squeezed in to show off their projects and discuss how NetBeans has been advantageous and how it can improve, both within the IDE and beyond on the side of the NetBeans Platform. The line up of speakers is growing continually, check out the program and the star studded cast of speakers here. Come to NetBeans Day and meet, in addition to the NetBeans Team, developers from PrimeFaces, ESPN, NATO, and many other organizations.

  • Wicket. I updated the Wicket tutorial for NetBeans, which uses Wicket 1.5.3. Several links in the tutorial were wrong, pointing to wrong versions of the plugin, as well as broken screenshots. Once Wicket 6.0 comes out, the plugin will be updated accordingly, though the current stable release of Wicket is 1.5.7. Changing to a different version of Wicket is easy, however, and doesn't necessarily require an update to the NetBeans Wicket plugin, as described in this blog entry, i.e., create a new library in the Library Manager in the IDE, with a name beginning with "Wicket", containing the Wicket JARs of your choice, and then that library will be available when you create your new Wicket web application.

  • Gradle. Attila Kelemen has published an article describing how he's improved and extended the Gradle plugin for NetBeans that I had described earlier in this blog. Please try out his plugin and provide him with feedback. I'll be sure to try it out myself too in the next few days.

  • Ruby on Rails. I've been figuring out with Tom Enebo (and Jesse) what's needed to upgrade the Ruby community plugin to 7.2. Because of this issue some problems have arisen in the plugin. I've checked out the community plugin sources and excluded pieces of it enabling it to compile and the plugin to run. I can create projects and edit Ruby code. Deployment and testing may need some rework, depending on how much of it is actually used by the Ruby plugin and how much of it is unused legacy code. A bit of investigation is needed in this regard and I'd be happy to check my tweaked version of the community plugin into a branch on the repo as a starting point.

  • FreeMarker. I blogged a bit some months ago about FreeMarker support. The sources of the plugin I described are now available here on The plugin isn't everything it could/should be, so I am hoping for code contributions, while I will provide a complete overview of the functionality that is available soon. No binary of the plugin is currently available.

  • NetBeans Platform Applications. Several hidden NetBeans Platform applications have shown up in my inbox and elsewhere. Three of these, all looking extremely professional, come from GRID-IT, such as this one, which you'll find out more about, together with the other two applications, in a new article to be published soon:

    Other new or recent articles relating to NetBeans Platform applications include an article about refugee assistance by the UNHCR, Mercur Business Control in Sweden, Zirius in Norway, and YouTube movies of an open source media system created in England. There's also a cool new article by the Kuwaiba team about Open Street Map integration with the NetBeans Platform that I'd like to dig into soon, together with Hermien Pellissier's latest Maven/NetBeans tips. Best of all, in the coming months several more NetBeans Platform training courses are available for you to join, as described here and here.

  • NetBeans IDE Tips. And to top it all off a very excellent article has just been released by Tom McGinn, from the Oracle Curriculum Development team, containing a list of tips and tricks for NetBeans IDE usage.

So, enough things going on to keep me off the streets for a while. And I haven't even mentioned some very cool things that are a bit secret right now. Watch this space in the coming weeks for details...


Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.


« August 2012 »