Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java me 如何减少LWUIT TextArea中文本的字体_Java Me_Lwuit_Nokia S40 - Fatal编程技术网

Java me 如何减少LWUIT TextArea中文本的字体

Java me 如何减少LWUIT TextArea中文本的字体,java-me,lwuit,nokia-s40,Java Me,Lwuit,Nokia S40,我已经创建了LWUITTextArea,并且在我的TextArea中添加了文本段落,现在我想减小我的TextArea的字体大小,我使用了以下代码: TextArea big = new TextArea(detailNews.getDescription()); Font createSystemFont = Font.createSystemFont(Font.FACE_SYSTEM, Font.STYLE_ITALIC, Font.SIZE_SMALL); big.getStyle(

我已经创建了LWUIT
TextArea
,并且在我的
TextArea
中添加了文本段落,现在我想减小我的
TextArea
的字体大小,我使用了以下代码:

TextArea big = new TextArea(detailNews.getDescription());
Font createSystemFont = Font.createSystemFont(Font.FACE_SYSTEM, Font.STYLE_ITALIC, Font.SIZE_SMALL);
    big.getStyle().setFont(createSystemFont);
    big.setEditable(false);                    
    form2.addComponent(big);
    form2.show();

但是,为什么我不能减少文本的字体?

在资源编辑器中创建字体。然后,从应用程序中的资源文件导入字体。通过使用此方法,您可以对安装在系统中的应用程序应用任何字体。您还可以为字体设置任何字体大小

浏览链接了解如何在资源编辑器中创建字体

使用:

TextArea big = new TextArea(detailNews.getDescription());

Font createSystemFont = Font.createSystemFont(Font.FACE_SYSTEM, Font.STYLE_ITALIC,Font.SIZE_SMALL);

big.getUnselectedStyle().setFont(createSystemFont); 
big.getSelectedStyle().setFont(createSystemFont); 

// Added TextArea object big to the Form object form.
form.addComponent(big);
form.show();