Java me 如何减少LWUIT TextArea中文本的字体
我已经创建了LWUITJava 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(
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();