Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 41
Registered: ‎09-28-2009
My Device: Not Specified
Accepted Solution

Easy question - Why doesn't this long text field vertical scroll?

This has to be an easy one, but I've spent too long trying to make it work.  I have a screen that displays a long string (EULA text), followed by a few buttons.  I can't get the text to vertical scroll.  What am I missing?  I've tried various combinations of flags on the manager with no luck.    I've tried using both a LabelField and a RichTextField .

Thanks!

 

Here's the constructor for the MainScreen class:

 

 

	public EULAScreen() {

		super();
		
		VerticalFieldManager mgr2 = new VerticalFieldManager(Manager.VERTICAL_SCROLL|Manager.USE_ALL_HEIGHT);

		mgr2.add(new LabelField("Scroll to the bottom and click I AGREE to accept this agreement.\n \n"));
		lbEULA = new RichTextField(EULATEXT,RichTextField.USE_ALL_HEIGHT);

		mgr2.add(lbEULA);  // lbEULA is a multi-line private static final String 
		mgr2.add(acceptButtonField); 
		mgr2.add(notacceptButtonField);
		add(mgr2);
	}

 

 

Developer
Posts: 984
Registered: ‎02-10-2009
My Device: Not Specified

Re: Easy question - Why doesn't this long text field vertical scroll?

[ Edited ]

Try somthing like below:

 

//main screen
public EULAScreen()
{
super(NO_VERTICAL_SCROLL);
VerticalFieldManager mgr2 = new
VerticalFieldManager(Manager.VERTICAL_SCROLL|Manager.VERTICAL_SCROLLBAR)
{
protected void sublayout( int maxWidth, int maxHeight )
{
int displayWidth = Display.getWidth();
int displayHeight = Display.getHeight();

super.sublayout( displayWidth, displayHeight);
setExtent( displayWidth, displayHeight);
}

};
mgr2.add(new LabelField("Scroll to the bottom and click I AGREE to
accept this agreement.\n \n"));
lbEULA = new RichTextField(EULATEXT,RichTextField.USE_ALL_HEIGHT);

mgr2.add(lbEULA);
// lbEULA is a multi-line private static final String
mgr2.add(acceptButtonField);
mgr2.add(notacceptButtonField);
add(mgr2);
}

 

@Edit : typo

 

Regards

Bikas

Developer
Posts: 41
Registered: ‎09-28-2009
My Device: Not Specified

Re: Easy question - Why doesn't this long text field vertical scroll?

That did the trick - Thanks!