我创建了 LWUIT TextArea。我想减小 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) {
}
但是 TextArea 显示问题,如下所示:
----------------------------------
|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 |
----------------------------------
我在这里上传图片
请帮我!