Skip to main content

Working with Netbeans 4.2 Dev - Part 1

This past week has been an avalanche of new open source announcements. In particular there's been the final release of Eclipse 3.1, a preview of Matisse with the Netbeans 4.2 developer release, and the release of Trolltech's QT 4 for Windows, X11, and Mac OS X under their open source license. In this post I'm going to talk about Netbeans 4.2 and the many new features, large and small.

I downloaded and installed the development version of Netbeans. Given time this will become Netbeans 4.2. This release comes with three new major features that I am aware of; code completion extensions, support for Netbeans module creation, and Matisse, the GUI builder. I'll talk about the GUI builder in this post.

I downloaded the June 28th developer build from the developer build section of the Netbeans website. I downloaded the installer executable for Windows and then ran it. I then edited the file etc/netbeans.conf per the instructions on the Matisse page to enable the GUI construction tool extensions. After that it was a simple matter to fire it up.

I use Eclipse for a lot of Java development, and I've gotten into the habit of right clicking on the Package Explorer pane to create a new project. For Netbeans 4.1 and earlier this does not work. But for Netbeans 4.2 development, it does. Figure 1 shows the Project pop-up for Netbeans 4.2 dev. Figure 2 shows the Package Explorer pop-up for Eclipse 3.1.


Figure 1

Figure 2


Clicking on "New Project produced a project selection dialog (Figure 3) and another surprise. You can now explicitly create two types of Netbean module projects. In fact, it turns out there are now new tutorials for building plugins on the Netbeans site.


Figure 3

Once I had the project created I added a JFrame form to the project (Figure 4). From there I started to add various controls from the Palette.


Figure 4

One of the controls I attempted to add to the JFrame was a vertical slider (see Figure 5). The sliders on the Palette default to horizontal. So I placed the slider on the form and then attempted to change its orientation via the sliders properties panel. That produced an immediate exception. I noticed while working with the slider that every time I touched it I got an exception, until the Netbeans IDE would no longer work stably. I then had to shut down the IDE and start it back up.


Figure 5

The last figure, Figure 6, shows the layout with its indicators. (And yes, I know this is super ugly, but that's not the point). I am very interested to know what the various icons on the layout form mean. The lines are clear enough. They help to line up all the various controls, and they dynamically change as the controls are moved around the form. The semi-circles seem to indicate an anchor point.


Figure 6

Impressions

The layout of Swing controls is clean and fairly intuitive. The alignment lines appear when they're needed, such as when elements line up (along top edges, side edges, or the centers of controls). I've yet to attempt to attach actions to the controls. The code generated by the layout tool is clean and understandable. An attempt to create a radio button group failed for me, but that could be my lack of understanding of how to use the tool properly. Hitting the form preview button on the editor generates a nearly instantanious frame with the controls. On Windows the preview is excellent. Over time the IDE seemed to stutter when adding controls or moving them around, but this may have been due to the exception generated by the slider exercise. Double clicking on any control allowed me to easily change the associated label text. Right clicking on any control brought up its property dialog and allowed me to inspect and change properties. Good.

While the alignment lines are good, I have to wonder what is wrong with the Visual Basic-style of control layout using a grid on the form. Symantec used this with Visual Cafe (Version 3) six years ago back when it was in the Java tools business. Other form creation tools, such as Trolltech's Designer, still use that method with great success. Surely snapping to points on a grid would be easier than what Netbeans Matisse is attempting? What's wrong with Netbeans (or Eclipse, for that matter) using the same style of layout?

Comments

  1. Hi Bill, thanks for giving Matisse a try -- and providing very useful feedback.

    Regarding exceptions, the current version is just a prevew so sometimes things do go wrong... The 'good news' :) is that most of the time it is enough to close and reopen the form, without having to restart the IDE.

    To your question on showing the grid on the form, there is simply no need for that in Matisse. Generated layout is not based on a grid concept nor on absolute XY coordinates (it uses parallel / sequantial groups of components instead), and the guidelines seem to be good enough to visualize the constraints between components -- or so we thought... :)

    Arseniy

    ReplyDelete

Post a Comment

All comments are checked. Comment SPAM will be blocked and deleted.

Popular posts from this blog

cat-in-a-box channels greta garbo

So I'm sitting at my computer, when I start to notice a racket in back. I ignore it for a while until I hear a load "thump!", as if something had been dropped on the floor, followed by a lot of loud rattling. I turn around and see Lucy in the box just having a grand old time, rolling around and rattling that box a good one. I grab the GX1 and snap a few shots before she notices me and the camera, then leaps out and back into her chair (which used to be my chair before she decided it was her chair).

Just like caring for Katie my black Lab taught me about dogs, caring for Lucy is teaching me about cats. She finds me fascinating, as I do her. And she expresses great affection and love toward me without coaxing. I try to return the affection and love, but she is a cat, and she takes a bat at me on occasion, although I think that's just her being playful. She always has her claws in when she does that.

She sits next to me during the evening in her chair while I sit in mi…

vm networking problem fixed

Over the weekend I upgraded to Windows 8.1, then discovered that networking for the virtual machines wouldn't work. Then I tried something incredibly simple and fixed the problem.

Checking the system I noticed that three VMware Windows services weren't running; VMnetDHCP, VMUSBArbService, and VMwareNatService. VMware Player allows you to install, remove, or fix an existing installation. I chose to try fixing the installation, and that fixed the problem. The services were re-installed/restarted, and the virtual machines had networking again.

Once network connectivity was established there was exactly one updated file for Ubuntu 13.10, a data file. This underscores how solid and finished the release was this time. Every other version of every other Linux installation I've ever dealt with has always been succeeded by boatloads of updates after the initial installation. But not this time.

Everything is working properly on my notebook. All's right with the world.

first night for the gingersnaps

The first night has passed and the two have managed to survive, in spite of what their tiny hearts might have thought when first arriving. Greebo, the larger of the two, has been in hiding the entire time so far. Ponder has spent the time zipping in and out of hiding spots, checking things out, and learning just how comfortable pillows are for resting your head.

During the night I felt the tiny body of Ponder hitting the bed as he leaped up on the side, and then climbed to the top to run around on top of me. At least once he play-attacked my fingers. He might be small but his claws are still quite sharp.

When I got up in the morning the bowl of cat kitten food was fairly well depleted. It's been refilled and fresh water put in the big dish on the floor. I'm assuming that both Greebo and Ponder are feeding and drinking. I have seen Greebo under the furniture peeking out at me when I went looking for him. I'm leaving him alone while he continues to adjust.

So far the guys h…