Search code examples
htmljava-melwuit

can we apply html css to LWUIT Text Area


I have used TextArea, but I am not able to reduce the font. Here is my code:

TextArea big = new TextArea(detailNews.getDescription());
Font createSystemFont = Font.createSystemFont(Font.FACE_SYSTEM, Font.STYLE_PLAIN,                        Font.SIZE_SMALL); 
big.getStyle().setFont(createSystemFont); 
big.setEditable(false);,

How can I reduce font?

I want to apply html css to LWUIT Text Area to reduce font of my text. Is that possible?


Solution

  • Use:

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

    You will get the smallest font you can reasonably use. Otherwise you will need to use bitmap fonts which aren't recommended.