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
BBDeveloper
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified
Accepted Solution

Scrolling BasicEditField

Hi,

I want to create a BasicEditField with a fixed width and the text entered should be vertical scrolling in that area.

 

Following is my code.

BasicEditField befield= new BasicEditField("World: ","") { public int getPreferredWidth() { return Display.getWidth(); } public int getPreferredHeight() { return 50; } public void layout(int width, int height) { super.layout(width, getPreferredHeight()); setExtent(width, getPreferredHeight()); } }; VerticalFieldManager vfm = new VerticalFieldManager(Manager.VERTICAL_SCROLL|Manager.VERTICAL_SCROLLBAR); vfm.add(befield); this.add(vfm);

 

I expected this code to display a BasicEditField of Height 50 and the text entered should be scrolling in the area. The text entered after the Height 50 is not visible.

 

What changes should i do.

 

Thq.

 


Use Search. "Accept Solution" If the problem is resolved.
Please use plain text.
Developer
BBDeveloper
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: Scrolling BasicEditField

Any suggestions.

Use Search. "Accept Solution" If the problem is resolved.
Please use plain text.
Administrator
MSohm
Posts: 14,227
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Scrolling BasicEditField

I think this sample will get you close to what you are looking for.

 

Pimp My Object: Creating a TextBox Field

http://na.blackberry.com/eng/devjournals/resources/journals/jul_2005/creating_textbox_field.jsp

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.