我製作了Container
化合物的TextArea
和CheckBox
。在我的應用程序中,我創建了許多這樣的「Containers
」,並在其中添加了其中的每個TextArea
ActionListener
(由類實現)。事情是這樣的:LWUIT TextArea不捕捉觸摸事件
for(int i = 0 ; i<20;i++){
MyContainer c = new MyContainer();
TextArea t = c.getTextArea();
t.addActionListener(this);
}
我想TextArea
趕上事件,如果按下它把CheckBox
選中或取消選中。它在非觸摸設備和模擬器中工作正常,但在觸摸設備或模擬器中,TextArea
未捕獲該事件。我試圖將TextArea
作爲Container
的主要組件,但它不起作用,因爲Container
沒有addActionListener
方法。