How to reduce text font in LWUIT TextArea

I created LWUIT TextArea and I added paragraphs of text to my TextArea , now I want to reduce the font size of TextArea , I used the following code:

 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(); 

But why can't I reduce the font of my text?

+4
source share
2 answers

Using:

 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(); 
0
source

Create a font in the resource editor . Then import the font from the resource file in your application. Using this method, you can apply any font to your application installed on your system. You can also install any font font.

Check out the link to learn how to create a font in the resource editor.

http://docs.oracle.com/javame/dev-tools/lwuit-1.4/LWUIT_Developer_Guide_HTML/cjbcgcdd.html#z400088e1296018

+4
source

All Articles