Laying out UI components using the visual editor

You can use the visual editor for Java to visually arrange and lay out user interface (UI) components in your Java application. The editor supports various SWT and Swing layout managers.

Before you can layout UI components, your Java class must contain a container, such as JFrame, JPanel, Composite, or Shell, that allows for a layout manager to be set.

When you design an application, you should make the user interface easy to use, intuitive, well-organized, and visually appealing. You can customize the layout of your application to improve its usability and make it fit your needs.

When you add containers in a Java visual class, the editor uses default settings for the layout and alignment of components within those containers. For example, the default layout manager in the visual editor for JPanel is FlowLayout, while other containers have layout set to null.

To specify a layout manager for a container, set the layout property:

  1. In the Design view or Java Beans view, select the container that you want to specify a layout manager for.
  2. In the Properties view, locate the layout property, and click its value column.
  3. Select the layout manager that you want to use for the container.

(C) Copyright IBM Corporation 1999, 2004. All Rights Reserved.