New Tutorial for NetBeans Platform Developers

This tutorial shows you how to integrate a MySQL database into a NetBeans Platform application. We start by exploring a MySQL database, for which we create an entity class. However, note that these instructions are not applicable to MySQL only. Rather, they are relevant to any relational database supported by NetBeans IDE. Next, we wrap the entity class into a module, together with modules for the related JPA JARS.

Once the above modules are part of our application, we create a new module that provides the user interface for our application. The new module gives the user a tree hierarchy showing data from the database. We then create another module that lets the user edit the data displayed by the first module. By separating the viewer from the editor in distinct modules, we will enable the user to install a different editor for the same viewer, since different editors could be created by external vendors, some commercially and some for free. It is this flexibility that the modular architecture of the NetBeans Platform makes possible.

Once we have an editor, we begin adding CRUD functionality. First, the "R", standing for "Read", is handled by the viewer described above. Next, the "U" for "Update" is handled, followed by the "C" for "Create", and the "D" for "Delete".

At the end of the tutorial, you will have learned about a range of NetBeans Platform features that help you in creating applications of this kind. For example, you will have learned about the UndoRedo.Manager and the ExplorerManager, as well as NetBeans Platform Swing components, such as TopComponent and BeanTreeView.

Click here to start working on this brand new tutorial:

Any feedback is more than welcome.


Good tutorial.
I wonder where to get the sample code

Posted by hantsy on March 22, 2009 at 02:52 PM PDT #

Hi hantsy. Thanks for liking the tutorial. The problem with the source code is that it also includes all the extra JARs and so on, as well as the problem that it wouldn't run out of the box since it assumes you have the particular database used in the tutorial. So I'm not sure if it would make sense to make the source code available since it can't be used "as is" anyway.

Posted by Geertjan on March 22, 2009 at 05:46 PM PDT #

Hi Geertjan,

Might you can organize the project's libraries, and as well use an embedded db (like derby).

Posted by Roger on March 24, 2009 at 01:09 AM PDT #

Well, I was supposed to use MySQL since that's the official Sun database server (yes, Derby too, but anyway).

Posted by Geertjan on March 24, 2009 at 02:01 AM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed

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.


« July 2016