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
New Developer
Posts: 6
Registered: ‎08-18-2008
My Device: Not Specified
Accepted Solution

Multiple Page text with scrolling

 

I have  created  a simple MenuScreen, and used RichTextField to add some more number of text lines,

 

While running this in the emulator 8100, 8300, It shows only the first few lines, while trying to scroll down,

and see more lines, Pressing down/scrolling is not working

I have tried with some listeners   , i havent get the result.

 

Could anyone pls suggest how to do this 

 

 // Here is the Code

 

 public class HelloWorld extends UiApplication
{
  
    public static void main(String[] args)
    {
    
        HelloWorldDemo theApp = new HelloWorldDemo();   
  
        theApp.enterEventDispatcher();
    }


    public HelloWorldDemo()
    {
        pushScreen(new HelloWorldScreen());
    }   
}

final class HelloWorldScreen extends MainScreen
{


    public HelloWorldScreen()
    {

        LabelField title = new LabelField("Hello World Demo" , LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);
        setTitle(title);

// Add multilple line text in the rich text field.

        add(new RichTextField("Hello World!  For the sake of simplicity, this sample application may not"+
  "resource bundles and resource strings.  However, it is STRONGLY recommended"+
  "experience across a variety of languages and geographies.  For more information"+ 
  "on localizing your application, please refer to the BlackBerry Java Development"+
  "Environment Development Guide associated with this release." ,Field.NON_FOCUSABLE));
    }

 }  

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

Re: Multiple Page text with scrolling

You have specified

Field.NON_FOCUSABLE

so the BlackBerry has nowhere to scroll to.  Replace this with

Field.READONLY and see the difference.

 

You will probably also notice on this screen with Field.NON_FOCUSABLE that you do not even see the 'cursor'. 

 

You could add NullFields before after this, however this will only allow display of the start and end of the data - which may not be what you want.  Try it and see.

Highlighted
New Developer
Posts: 6
Registered: ‎08-18-2008
My Device: Not Specified

Re: Multiple Page text with scrolling

Thanks a Ton.

It works fine

Developer
Posts: 89
Registered: ‎07-03-2009
My Device: Not Specified

Re: Multiple Page text with scrolling

[ Edited ]

peter_strange wrote:

You have specified

Field.NON_FOCUSABLE

so the BlackBerry has nowhere to scroll to.  Replace this with

Field.READONLY and see the difference.

 

You will probably also notice on this screen with Field.NON_FOCUSABLE that you do not even see the 'cursor'. 

 

You could add NullFields before after this, however this will only allow display of the start and end of the data - which may not be what you want.  Try it and see.


Hi Peter, 

 

I try with your suggestion, but still see the 'cursor'. Here is my code:

 

 

VerticalFieldManager vertical = new VerticalFieldManager(VerticalFieldManager.VERTICAL_SCROLL|VerticalFieldManager.VERTICAL_SCROLL|Field.NON_FOCUSABLE);

String explanation = "nothing \n gonna \n change \n my \n love \n for you \n if \n tomorrow \n never come \n";
explanation += "time 2 \n " + explanation;

RichTextField expl = new RichTextField(explanation,Field.USE_ALL_WIDTH|USE_ALL_HEIGHT|Field.READONLY);

vertical.add(expl);

add(vertical);

 

  I wish something like the about page of BB, scrolling a richtextfiled without 'cursor' (the text focus).

 

Thank you. 

 

(I am using JDE 4.6)

Message Edited by thanhbinh84 on 08-28-2009 11:02 AM