Skip to main content

Got JavaBeans? Here's a way to distribute them...

Posted by timboudreau on April 3, 2006 at 11:53 AM PDT

BeanNetter - the NetBeans Module Generator

So NetBeans has this cool component palette from which you can drag and drop components onto Swing componentPalette.png

forms. But where are all the cool components? NetBeans just shows the default JDK Swing components - but there are lots of components out there. Wouldn't it be nicer if you could make them just appear in your IDE? And there are sites such as nbextras.org with NetBeans plug-ins, and there is an update facility built into NetBeans - so why shouldn't you be able to download JavaBeans straight into the IDE from them? Well, first, it needs to be easy to create a NetBeans module that embeds JavaBeans and puts them on the Component Palette.

So I wrote a small tool that generates a NetBeans plugin. It's a wizard, and you point it at a JAR file with some Swing components in it. It finds all the declared JavaBeans that are there, and lets you choose to add or remove other classes. Then it asks for some info like the name of the library - this will be your Beans' category on the Component Palette.

When you complete it, it generates a complete, redistributable NetBeans Module (.nbm file - the distribution format for plug-ins - a glorified zip file), and all of the components you selected will show up on the Component Palette in their own category as soon as you install it in the IDE. Now...how to distribute these glorious plugins?

What to do with the results

Now you've got a module, but the point is to get that module to other people. How to do that? Well, first, if the components are open source, I bet the folks at nbextras.org would happily host them, and that site's been getting a lot of attention lately. If they're commercial, there is the Third Party update center that every release copy of NetBeans checks for plug-ins, and that could be a good place - the partner page would be a good place to start.

Sources and Screen Shots

Sources are in contrib/Beans2nbm/beans2nbm in CVS on NetBeans.org.
The tool also happens to showcase one of my (far too many) weekend projects, the Wizard project.


wizardPanel2.png

BeanNetter - the NetBeans Module Generator


wizardLicense.png

Choosing a License - Extra points if you can identify the text above

Related Topics >>