Problem
The Field.setFont(Font font) method should be used to set or change the font used by any field in the BlackBerry API set. A font should not be set or changed within the Field’s paint method. The following code example will NOT work:
LabelField myField = new LabelField("Hi there.") |
Resolution
The Field’s setFont method should be used in the following way:
LabelField myfield = new LabelField("Hi there.") |
This allows for the font used within a specific field to be set. To change a font for the entire application, the Font.setDefaultFont(Font font) method should be used.
Note: This does not mean that the Graphics.setFont method should not be used. If you are performing custom drawing actions using the Graphics class on a custom Screen or Field, the setFont method can be used to change the font that is being drawn. Graphics.setFont should not be used to change the font being drawn by existing fields contained within the BlackBerry API set. Under this circumstance, the Field.setFont method should be used.
No comments:
Post a Comment
Place your comments here...