我有n
一些数据必须添加到标签字段中,而标签字段又必须添加到 hfm。我将单个数据设置为标签字段:
final LabelField desc = new LabelField("", LabelField.FOCUSABLE);
final LabelField desc1 = new LabelField("", LabelField.FOCUSABLE);
Vector data = (Vector) listEvent.get(keys);
for (int i = 0; i < data.size(); i++) {
EventData ee = (EventData) data.elementAt(i);
String Summary= ee.getSummary();
if (time.getText().equals(sTime)) {
desc.setText(Summary);
}
else{
desc1.setText(Summary);
}
}
HorizontalFieldManager horizontalFieldManager_left18 = new HorizontalFieldManager() {
horizontalFieldManager_left18.add(desc1);
vfm.add(horizontalFieldManager_left18);
vfm.add(new SeparatorField());
HorizontalFieldManager horizontalFieldManager_left17 = new HorizontalFieldManager() {
horizontalFieldManager_left17.add(desc);
vfm.add(horizontalFieldManager_left17);
vfm.add(new SeparatorField());
在上面的代码中,我循环遍历向量并将数据设置为稍后labelfield
添加标签。hfm
现在的情况是矢量数据有多个汇总数据,并且数据被覆盖labelfield
,我需要将n
汇总数据的数量保留到标签字段中并添加到新的hfm
。