使用 LWUIT,我有Form两个组件:一个只读TextArea和一个Button:
TextArea text = new TextArea("blah blah blah blah blah blah blah blah blah ...");
text.setEditable(false);
form.addComponent(text);
Button button = new Button("Press Me !");
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
// DESIRED CODE IS HERE ...
}
});
form.addComponent(button);
有TextArea一个Scrollbar因为它包含一个long String,当用户向下移动DOWN'TextArea直到Scrollbar它到达末尾时String,然后将Button焦点留TextArea在Scrollbar末尾TextArea。
我希望,当Button单击 时,滚动条返回到其原始状态,Top而TextArea不是在Bottom中TextArea。我怎么能这样做?