8.8.1 Using Null Layout
If a container holds components whose size isn't affected by the container's size or by font and look-and-feel changes, then absolute positioning might make sense. Desktop panes which contain internal frames belong to this category. The size and position of internal frames doesn't depend directly on the desktop pane's size. The programmer determines the initial size and placement of internal frames within the desktop pane and then the user can move or resize the frames. A layout manager is unnecessary in this situation.
In the Null Layout, the beans can be placed anywhere. The beans are simply dropped into the draw area and the beans stay where they are dropped. The default layout of a screen is Null Layout.
Resizing in Null/Position Layout:
In Position layout/ Null layout (which is the default Layout set in the Draw Area), you will be able to resize the component with the help of the mouse and also you can set the bounds in the property form.
Aligning Beans in Null Layout
The bean components in a screen can be aligned by using the Alignment feature. This provides an accurate way of aligning, setting same width/height and setting the spacing between the selected components. By using this feature, the UI can be made more uniform and this is applicable only for components in a Null Layout. This will be explained by the following example.
Drop a few beans into the Bean Builder draw area. Click on one of the beans. This bean gets selected. Press the "Shift" key and click on the next bean. This bean also gets selected. Similarly, select the other beans that have to be aligned. Now, right-click and a pop-up menu with different menu-items appear as shown in the picture below.
You can use the "Right Align", "Left Align", "Top Align", "Bottom Align" and "Center Align" to set your desired positions.
Use the "Horizontal Spacing" and "Vertical Spacing"options to set the space between these beans.
By using the "Same Width" and "Same Height" options, you can set equal width/height for the beans.
Note: In case of multiple bean selection, all the menus in the popup list will be enabled only when your first selected bean lies in the draw area.