Rajapandian
Rajapandian

Reputation: 9317

How to set a ScrollBar to the VerticalFieldManager in Blackberry?

I am using this code to set the scrollBar to the VerticalFieldManager in Blackberry

   VerticalFieldManager temp2=new VerticalFieldManager(VerticalFieldManager.VERTICAL_SCROLL);
   LabelField result=new LabelField("Result \n Result\n Result\n Result \n Result\n");   
   temp2.add(result);

The labelField is added and the contents are displayed by the VerticalFieldManager is not getting scrolled.Is my code is correct?.If anyone have any idea to handle this please help me.

Upvotes: 3

Views: 4734

Answers (2)

iKushal
iKushal

Reputation: 2869

My solution:

VerticalFieldManager temp2=new VerticalFieldManager(Manager.VERTICAL_SCROLL);
LabelField result=new LabelField("Result \n Result\n Result\n Result \n Result\n",FOCUSABLE);   
temp2.add(result);
VerticalFieldManager temp=new VerticalFieldManager();
temp.add(temp2);
add(temp);

Upvotes: 1

Maksym Gontar
Maksym Gontar

Reputation: 22775

 1. Set VerticalFieldManager style to VERTICAL_SCROLL|VERTICAL_SCROLLBAR    
 2. Add a new NullField(Field.FOCUSABLE) after LabelField

Upvotes: 4

Related Questions