Chapter 11, Native Integration and Packaging
#86 Make Quick Look and Feel Changes
Text components have font settings in addition to their colors. This lets you
set a component to use a different font style or size. You can even load a cus-
tom font from a file:
Font font = Font.createFont(Font.TRUETYPE_FONT,
font = font.deriveFont(Font.BOLD,16f);
This would look like Figure 11-12.
Most components also have margins that are defined by an
Insets object. A
text field with large insets:
UIManager.put("TextField.margin", new Insets(25,25,25,25));
would look like Figure 11-13.
Figure 11-11. A sample program with green components
Figure 11-12. A custom font