我在j2me编程,我需要用丰富的格式编写文本来获取帮助屏幕

时间:2010-08-06 08:23:03

标签: java mobile java-me mobile-phones

我正在编写J2me应用程序。我有一个菜单,可以选择帮助。

对于这个屏幕,我需要提供一个包含一些粗体词,斜体等的文本......

哪个是最佳选择?

我的第一个解决方案:

StringItem messageItem = new StringItem("","");
messageItem.setText("lorem ipsum etc etc...");
messageItem.setFont(Font.getFont(Font.FACE_SYSTEM,Font.STYLE_BOLD,Font.SIZE_MEDIUM)); 
append(messageItem);

然后使用另一种字体样式添加另一个新的StringItem:

    StringItem messageItem2 = new StringItem("","");
...
 append(messageItem2);

有更好的解决方案吗?

2 个答案:

答案 0 :(得分:0)

一种可能的解决方案是使用外部UI库,例如LWUIT。

请看这个: http://www.nextgenmoco.com/2010/02/mobile-web-and-html-inside-javame-with.html

答案 1 :(得分:0)

更简单的选项:http://www.j2mehtml.com/