开发者

Changing font size in j2me

Can we chang开发者_JAVA技巧e the siz,style,etc of the font (javax.microedition.lcdui.Font) in j2me


@org.life.java That be true that there isn't a set size method..... that being said there isn't a "setSubstring" method either.

Strings as with fonts in J2me are immutable http://en.wikipedia.org/wiki/Immutable_object so simply create a new font with the desired properties....

http://download.oracle.com/javame/config/cldc/ref-impl/midp2.0/jsr118/index.html

So instead of

 myfon.setSize(Font.SIZE_SMALL)

Do

myFont = Font.getFont(myFont.getFontFace(), myFont.getFontStyle(), Font.SIZE_MEDIUM)

That would work.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜