![]() |
![]() |
Another enhancement that you can make to your visual beans is to change the colors and fonts that the beans use.
If you are developing applets to be used on multiple platforms, you should carefully consider the effect of choosing colors and fonts that are different from the default system colors and fonts. For example, if you choose a particular font available in OS/2, that font might not be available in Windows. For more information, see Portability of colors and fonts.
The Backgound window opens:
Now double-click on a JLabel bean. Follow the same steps, again choosing the background property. This time a slightly different window appears, as shown below. To alter colors, use the slider controls, or select Basic or System and choose a color.
Note:
You cannot change the color of beans in Menus.
The Font window opens:
Note:
Some beans, such as Menu beans, may not support the changing of fonts depending on the
target platform.
If your applet will be used on multiple platforms, the colors and fonts of the beans must be available on all systems that will run your applet.
If you do decide to change the colors of beans in your applet, use only basic colors in the window, since non-basic colors may appear differently on different platforms.
If you decide to change the font of a bean, ensure that the font you choose will be available on all the systems that will be running the finished program. You might also have problems with certain fonts if your applet will be run on systems that use code pages designed for languages other than English.
![]() |
![]() |