NetBeans Platform on standalone Swing applications

Introducing NetBeans Platform basic concepts to Swing developers

Revision History
Revision 1.02011-03

1. Introduction

It's a good thing for an uneducated man to read books of quotations.

The NetBeans Platform offers a great open-source architecture to build enterprise-strength applications. Many companies use the NetBeans Platform as a sound basis to build all sort of applications.

Becoming proficient in the intrisics of the NetBeans Platform is often hard, despite of the good tutorials and learning courses available, because the Platform offers a vast set of features that, naturally, have to be learned. That's why I'm writing these notes, to smooth the learning curve, to make it easier for developers experienced with Swing technologies to get started with some NetBeans APIs!

1.1. Objectives. Pros and cons.

These notes introduce you to some of the basics of user interface design: the Nodes API, the Explorer API, the Property Sheet API and some of the most important UI components in the NetBeans Platform. Along the way we'll see some idioms and patterns you may find interesting as well.

The main objective of these notes is to introduce you to all these NetBeans Platform APIs so that you can run them in your own standalone Swing applications, this is, without the whole NetBeans Platform.

Not using the whole NetBeans Platform has, of course, some drawbacks: you won't be able to exploit the whole set of features. It has, nevertheless, some important advantages:

  • The development cycle is shorter. You can modify, build, run and test your GUI faster, as you don't have to compile a whole suite of modules. This is usually good if you want to polish some details in your GUI.

  • It makes migration easier. If you already have a Swing application and want to move it to the NetBeans Platform you can start by adapting it to the NetBeans GUI elements first. Once you have the basic UI working you may want to move to a full fledged NetBeans Platform application, exploiting some more advanced features (such as editors, update centers, java-source code analysis, refactoring, PHP or Ruby support, etc.).

  • Makes learning easier. By reducing the list of APIs to learn we make things easier, so that once you're proficient with these you can move to more advanced topics.

1.2. What we'll be doing

In order to keep things simple we'll be building a networked two-tier application but that doesn't involve databases, as setting the tables and installing database servers is an unneccessary complication. We'll be using the Twitter Search API instead, which doesn't require authentication, so the application will allow us to search stuff in Twitter.

We'll be architecting the application so that it's easy for you to add database support, if you want, or add authorization/authentication frameworks that allow you to log-in into Twitter (or any other web site) to see your tweets. Let's keep things simple: our objective is to learn the NetBeans APIs, not to build a database client.

1.3. Getting started

This is a list of things you will need to follow these notes:

  • A Java IDE, of course. This ranges from plain vi+command line to a full fledged IDE. Of course, I'm using the NetBeans IDE. You can use whatever you want for this, as fas as you're confortable with it.

  • Some jar files from the NetBeans Platform (see below for the whole list), version 7.0 Beta2 or above. You can get these by installing the NetBeans IDE and looking for them. Or you can just download the platform zip files.

  • The source code. I will be adding the source code for the application at You may want to import it into your IDE, or use it as a basis for building your own applications. The source code is released under both the GPL V2.0 with the Classpath exception and the CCDL v1.0 licenses, at your choice.

The list of jar files you'll need is as follows:


A great set of platform-wide utility functions (WeakListeners, RequestProcessors, and much more).


This is the NetBeans Lookup Library, the most important library on the NetBeans Platform.


This is the NetBeans Nodes API, probably the second most important API.


We'll need this for compilation purposes only (we need some annotations within this file). This jar file contains APIs for different kind of filesystems (yes, you can create your own filesystems too).


The NetBeans Platform Explorer API, we'll be using this to make UI development a snap.


The NetBeans Dialog API. We won't be using this directly, but it's needed because of dependencies.


The NetBeans AWT API. We won't be using this directly, but it's needed because of dependencies.


A great deal of UI components, including a TreeTable (Outline), advanced list and trees and more.

These jar files are relased under both the GPL v2.0 license (with the classpath exception) and the CDDL 1.0 license. This means that you can use the jar files in your own applications, even in commercial applications. Note that if you modify the files somehow (by adding a patch, for instance) you are required to make the modifications public too. Please adhere to any of the two licenses and be sure you understand them before using the jar files.

In order to use these jars you have to create a project in your favorite IDE and add the jars in the classpath of your project. How to do this depends, of couse, on your IDE. You're expected to do this yourself.

1.4. About these notes. Acknowledgements. Copying.

Note that I will be writing these notes during the following weeks, on my spare time, little by little, so we warned that I won't be doing this full time. I may add corrections or improve the notes as things evolve. Keep tuned.

I appreciate comments on the notes. Comments will be moderated, and all spam will be rejected.

I would like to thank 4G Soluciones for allowing me to write these notes, and for giving me some extra free time to work on them.

Finally I would also like to thank the NetBeans Team for building and improving the NetBeans Platform, a great way to build spiffy Swing applications.

These notes are Copyrighted material by Antonio Vieiro and 4G Soluciones. The notes are released under the Creative Commons CC BY-NC-ND 3.0 license. In order to copy, distribute or transmit these notes you will need a written permission by me and by 4G Soluciones.

You should be able to print the notes directly from here. There's a special css for printing that removes most unnecesary content. 4G Soluciones and I may relese the notes using the "epub" format, so that you can read them in your favourite e-reader. If you're interested in this then just drop me a line and I'll see what I can do.

Now, enough about legal stuff and thanks: let's get started!

blog comments powered by Disqus