我已经创建了LWUIT TextArea。我想减少我的TextArea的字体大小。我用下面的代码:LWUIT TextArea问题
public class TextAreaMidlet extends MIDlet {
public void startApp() {
Display.init(this);
Form mForm = new Form("Text Area");
mForm.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
Button button = new Button("Click here to open new Form");
mForm.addComponent(button);
TextArea textArea = new TextArea();
textArea.setEditable(false);
textArea.getStyle().setFont(Font.createSystemFont(Font.FACE_SYSTEM, Font.STYLE_PLAIN, Font.SIZE_SMALL));
textArea.setText("The quick brown fox jumps over the lazy dog, The quick brown fox jumps over the lazy dog, The quick brown fox jumps over the lazy dog, The quick brown fox jumps over the lazy dog, The quick brown fox jumps over the lazy dog, The quick brown fox jumps over the lazy dog, The quick brown fox jumps over the lazy dog");
mForm.addComponent(textArea);
mForm.show();
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
}
但文本区域显示问题,是这样的:
----------------------------------
|The quick brown fox |
|jumps over the lazy |
|dog, The quick brown |
|fox jumps over the lazy |
|dog, The quick brown fox |
|jumps over the lazy dog |
----------------------------------
我想它正常显示,类似这样的
----------------------------------
|The quick brown fox jumps over the|
|lazy dog, The quick brown fox |
|jumps over the lazy dog, The quick|
|brown fox jumps over the lazy dog |
----------------------------------
我上传图片here
请帮帮我!
如果我们在LWUIT API看,你可以看看你有一些构造,可以帮助你 – neb1
所以你要在文本区域右侧的文本对齐? – Lucifer
哦,是的。如果TextArea设置了Font:Font.SIZE_MEDIUM,它显示正常,但是用Font.SIZE_SMALL,它显示问题 –