A new perspective for SWING under NetBeans 6.0 M10


NetbeansI downloaded the new development version of NetBeans 6.0 (actually in M10) just for the kicks. I wanted to see if the new Ruby on Rails editing was any good, and I was recently surprised so. But not so much for the excellent Rails support, but rather for the new SWING look.

If what I read in the Internet is truth, there is no case discussing the future of desktops apps here. Everyone will tell you desktop applications are becoming few and scarce, and that web apps is the way to go. If we talk about SWING, the talk will probably die even earlier, since most of what I read is that SWING never lived up to its promises and that it never caught on because it looked sort of… ugly.

I tried SWING many times, and I confess that I found it as hard as any other GUI kit, say wxPython or Qt. Then NetBeans introduced Matisse, the GUI editor and made life easier for developing UI. But the Swing never looked good, or not as good as MFC or other tool-kits.

Maybe it’s too late to change the course of history, but I think people should look again and give NB 6.0 a try. Matisse is as good as ever, but the result is what surprised me: a clean, Window full look. I tried a little app to calculate the profit gain or loss from launching product line extensions. To test for cannibalization I used a slider, and several buttons and text controls for view.

Designing the app took a lot less time than using wxGlade, and the geometry manager gave me a professional look, unlike Glade where all the labels were off. Being a strongly typed language, I got the calculations for the analysis (yes, marketing has its own set of financial analysis formulas!) right the first time, unlike Python, where integer division simply trunks a result, so I had to investigate a while where my casting from integer to float was off.

Another thing that surprised me was how easy it is now to create simple CRUD applications from the template. Desktop applications from a new project have two distinct flavors: GUI and database. I downloaded the drivers for JDBC MySQL and passed on the parameters (in my case, localhost and database to use). Then you select the fields and that’s it! A full fledged CRUD application in minutes.

To database experts maybe the simple approach to CRUD is unelegant. But for people like me, who probably need to analyze the info and don’t care much for the best way to create CRUD panels, it’s a great tool.

I took NetBeans for a test drive on the weekend, when I revamped my dad’s accounting system in Rails from alpha version 2.0 to 3.0. The system is crude, but works for my dad. I thought maybe spending the next month tweaking the system, but found the tools in NetBeans so good, I finished before Sunday afternoon! Creating controllers, models, and views is a snap. The editing support for both Ruby and HTML is as good as RadRails, and I liked the great support for CSS also. Servers and consoles can be run from within NetBeans, and overall I felt so productive inside NB I find it hard to now go back to RadRails or Aptana.

I don’t see a lot of people like me, who code because they need to solve financial or marketing problems in the office space, and sometimes need tools where Excel or the calculator just won’t cut it. But I know we exist, and use programming as a way to automatize mathematical or logical analysis in a way which is easy and pleasent to users. After seeing how simple is to work, interact and create using SWING under NB 6.0, I think I might go back to a lot more Java programming that before.


4 thoughts on “A new perspective for SWING under NetBeans 6.0 M10

  1. sakuraba


    great post. I agree with you, NB 6.0 M10 makes it great and easy to develop with Swing.

    However please do not forget that this is not even a beta release of NB 6. So you must accept some cpu usage spikes (100 %) while working with it. This will all be solved in the final version, as we can see in NB 5.5.1, the current stable release, where you do not have these problems.

    I found Netbeans 6 a real “problem-solver”. You just start using it and it is so straightforward, you can just work and dont need to google around to find out how stuff works.

  2. sakuraba


    I have to add that most of the stuff that you can do with Swing in NB6 is also possible in NB 5.5.1, just the editor is not as good. The editor has been rewritten completely in NB6 to be more competitive with IDEA/Eclipse.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s