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);
    }
更改的时候只有对未初始化的窗体更改能够马上生效,其他的需要退出程序才能生效。

相关文章:

  • 2022-02-17
  • 2022-12-23
  • 2022-12-23
  • 2021-09-04
  • 2021-11-26
  • 2022-12-23
  • 2021-10-02
猜你喜欢
  • 2022-02-07
  • 2021-12-04
  • 2021-12-29
  • 2021-06-21
  • 2021-07-24
  • 2021-10-02
  • 2022-02-07
相关资源
相似解决方案