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
Highlighted
New Developer
Posts: 81
Registered: ‎03-22-2013
My Device: 9900,9930,9790,9780,9330
My Carrier: Blackberry
Accepted Solution

VericalFieldManager scrolling issue

Hello All,

 

I have added image in VerticalFieldManager . In paint method of vfm i have used drawText()  for adding text in manager.

Its need to add text in center of Image which changes on focus or click. Label is not fixed its dynamic text. So i used

drawText() not add().

 

Its working but i got issue while scrolling text. Text size is very large so entire text is not fixed on image its need to add horizontal scroll to text .

 

Please anyone tell me any solution for the same.

 

Thanks in Advance

 

 

 

Developer
Posts: 121
Registered: ‎05-31-2012
My Device: 9900
My Carrier: Airtel

Re: VericalFieldManager scrolling issue

I think you need to change your approach.

 

By your post, it seems you want the image as background only.

So you can set the image as background of VFM.

add a HorizontalFieldManager and add your LabelField.

 

For the following -Label is not fixed its dynamic text.

You can always change the text on LabelField by using its setText() method.

 

Rishikesh Singh
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: VericalFieldManager scrolling issue

I agree with the other post that a change of approach is needed, though perhaps I would suggest a different solution.

 

I would avoid using paint in a Manager if you can possibly do so, however as a method of creating the background to the Manager it is usually OK.  Though in the case you are using it to create a background, then I would use paintBackground(). 

 

But that does not help here.

 

I understand the requirement to be able to scroll long text, if you are ,displaying it in a single line.  The first question to ask is do you have to display it in a single line? 

 

Assuming that you do, then the next question is how does the user initiate this scrolling, or does it happen automatically.  Can you think about this, as the possible solutions will vary depending on your answer.   

New Developer
Posts: 81
Registered: ‎03-22-2013
My Device: 9900,9930,9790,9780,9330
My Carrier: Blackberry

Re: VericalFieldManager scrolling issue

Thanks Rishikesh and Peter,

 

I have mentioned here scrolling horizontally sorry for that. I need Marquee effect for that text which is single line.

I tried using above solution by Rishikesh but it gives me focus issue. whole manager is not focused when focus received only labelField  background is gettinng focus.

 

Please tell me any solution for this.

 

Thanks in Advance

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: VericalFieldManager scrolling issue

There are a number of Threads on the forum that talk about this.  Please search.  When searching you might also look for 'ticker' since I think it is called that sometime.  You might find the following link useful:

 

http://supportforums.blackberry.com/t5/Java-Development/Text-scrolling/m-p/154131#M18039

New Developer
Posts: 81
Registered: ‎03-22-2013
My Device: 9900,9930,9790,9780,9330
My Carrier: Blackberry

Re: VericalFieldManager scrolling issue

Thanks Peter,

 

This realy helped me alot. It works for adding Marquee effect to labelfield. My issue of scrolling is solved Smiley Happy