lwuit默认的字体是比较小的,所以我们可以在系统上做个设置字体大小的。
首先在Midlet上设置字体大小,
   Font.setDefaultFont(Font.createSystemFont(Font.FACE_SYSTEM,
       Font.STYLE_PLAIN, Font.SIZE_MEDIUM));
 Font.SIZE_MEDIUM这个值改成读变量的,
然后就是读取了,在 UIManager类上:
    public Style getComponentStyle(String id){
        Style style 
= null;
        
        
if(id == null || id.length() ==0){
            
//if no id return the default style
            id = "";
        }
else{
            id 
= id + ".";
        }
        
        style 
= (Style)styles.get(id);
        
        
if(style == null){
            style 
= createStyle(id);
            styles.put(id, style);
        }

       
//设置系统字体(读取)
        style.setFont(Font.getDefaultFont());
        
        
return new Style(style);
    }
更改的时候只有对未初始化的窗体更改能够马上生效,其他的需要退出程序才能生效。
posted on 2009-08-10 08:52  tatung zhang  阅读(1154)  评论(0编辑  收藏  举报