Changing Foreground and Background Colors

You can change the foreground (font) and background colors of the windows and the palette components directly through the attribute editor or with the Foreground and Background dialog boxes.

To change colors through the attribute editor:

  1. Select the component or container.
  2. Open the attribute editor by clicking on its button in the main toolbar.
  3. Type the name of a color (or its hexadecimal value) in the foreground or background box.
  4. Click OK in the attribute editor to set the color.
To try out various colors, click Apply instead of OK to keep the attribute editor open.

To change colors through either the Foreground or Background dialog box:

When you select a color value using one of these methods, the Foreground or Background dialog box provides you with the following feedback:


Click the Reset button to return the value to the default color (gray for background; black for foreground).


If you decide to change colors for a container, apply the color changes to the container before changing any component colors. Color changes to a container override any color settings applied previously to the components within the container.

See also:

Laying Out the Interface
Generating Java Source Code
Visual Java GUI Builder API Documentation
Visual Java GUI Builder Runtime Packages
Class Hierarchy
Index of All Fields and Methods