开发者

Changing font size in j2me

开发者 https://www.devze.com 2023-01-25 02:19 出处:网络
Can we chang开发者_JAVA技巧e the siz,style,etc of the font (javax.microedition.lcdui.Font) in j2me@org.life.java

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

精彩评论

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