java我正在用j2me编程,我需要用丰富的格式编写文本以获得帮助屏幕
我正在编写一个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);
有更好的解决方案吗
共 (0) 个答案