ONE OF THE AREAS IN WHICH NETBEANS IDE PROVIDES THE MOST INNOVATIVE SUPPORT is for creating Java clients using Java Foundation Classes (JFC or "Swing") and AWT packages. In addition to support for building applications on top of the NetBeans Platform, NetBeans IDE also provides cutting-edge tools to design individual forms, components, and dialogs. In the 5.0 release, NetBeans IDE revolutionized the approach to GUI layout management by introducing Project Matisse the combination of a new layout manager called GroupLayout and a visual interface used to design forms with this layout manager. The Matisse approach arranges components using aligning and relative proximity rather than nested containers and absolute X and Y coordinates. Components are anchored to the sides of a container and to other components. You can set two components to, for example, be aligned along the baseline or along the left or right edge. When the the size of components changes, either when the form is localized or when the user resizes the form, all of the components remain aligned correctly. Another advantage of the Matisse approach is that the default spacing between components is defined by the look and feel of the program rather than in absolute pixels. This means that your form will always look like a native application on an operating system. NetBeans IDE includes a number of tools for working with Java GUI forms, including:
The Form Editor, Inspector window, Palette window, and Properties window are shown in Figure 6-1. You can access the Connection wizard and Form Tester from buttons in the toolbar area of the Form Editor. Figure 6-1. Form Editor windows, including the Inspector, Form Editor (Design View), Palette window, and Properties windowThis section does not provide a complete guide to developing visual applications with Swing in NetBeans IDE; a whole book could be devoted to that. Instead, it focuses on a few of the unique but somewhat tricky features of Swing and the IDE that assist in the designing of visual applications. |