【发布时间】:2013-03-22 08:18:37
【问题描述】:
我想在每一行中获取按钮单击事件。如何得到它?我试过这个link,如果每行只有一个按钮,它就可以工作。但就我而言,每一行都有多个按钮。 10,20 和 11,21 是我的按钮。
在上面链接的 RowManager 类中,我添加了以下代码 -
button = new ButtonField("1" + index, ButtonField.CONSUME_CLICK);
button.setCookie(new Integer(index));
button.setFont(textFont);
add(button);
button1 = new ButtonField("2" + index, ButtonField.CONSUME_CLICK);
button1.setCookie(new Integer(index));
button1.setFont(textFont);
add(button1);
现在在 StackScreen 类上,public void fieldChanged(Field field, int context),我如何获得点击按钮的名称?
【问题讨论】:
-
下面这张不错。
标签: blackberry