how to create a array of labelfields

Posted by sheetal_r oswal on Stack Overflow See other posts from Stack Overflow or by sheetal_r oswal
Published on 2012-04-05T05:26:37Z Indexed on 2012/04/05 5:29 UTC
Read the original article Hit count: 149

Filed under:

I have 'n' number of data which has to be added to a label field which in turn has to be added to hfm.I am setting the single data in to label field as :

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());



In the above code i loop over vector and set the data into labelfield and adding the label to hfm later.

Now the case is the vector data has more than one summary data,and the data is getting overridden in labelfield,i need to keep 'n' number of summary data into lablefield and add to new hfm.

© Stack Overflow or respective owner

Related posts about blackberry