×

Discussion Board

Results 1 to 14 of 14
  1. #1
    Registered User
    Join Date
    May 2013
    Posts
    153

    please help,how to scroll textArea in s40-with-theme

    hello i am working on nokia asha skd1.0 latest paltform and nokia sdk2.0 .i my application i am using textArea but my TextArea is not scrolling .It is big issue for me please help me my code regarding textArea is given below
    Code:
                      TextArea thoughttext=new TextArea();
       			
       			String string="HELLO THIS IS  A NEW VERSION HELLO THIS IS  A NEW VERSION HELLO THIS IS  A NEW VERSION HELLO THIS IS  A NEW VERSION"
       			
       			 thoughttext.setText(string);
       			 
       			 
       			 
       			/thoughttext.getUnselectedStyle().setBorder(null, false);
       			 thoughttext.setPreferredH(middlecomponentHT);
       			
       			 thoughttext.setEditable(false);
       			 
       			 thoughttext.setSingleLineTextArea(false);        
       			 thoughttext.setGrowByContent(true);       
       			 thoughttext.setFocusable(false);
       			 //thoughttext.setFocus(false);
       		
       			
       			 thoughttext.getUnselectedStyle().setAlignment(Component.CENTER);
       			 thoughttext.setScrollVisible(true);
       			
       			
       			thoughttext.getUnselectedStyle().setFgColor(32768);

    please help me i got stuck .Thanks

  2. #2
    Registered User
    Join Date
    Mar 2013
    Location
    Nasik, India
    Posts
    21

    Re: please help,how to scroll textArea in s40-with-theme

    You are making textarea non-focusable by using thoughttext.setFocusable(false);
    Just make it focusable by using thoughttext.setFocusable(true); and set requestFocus() on the same.

    Thanks & Regards,
    Vishal Bharati.

  3. #3
    Registered User
    Join Date
    May 2013
    Posts
    153

    Re: please help,how to scroll textArea in s40-with-theme

    Thanks Vishal ,But according to my requirment i can't make it focusable and i set requestFocus() but even then it is not working as scrollable...how i make it scrollable.......

  4. #4
    Registered User
    Join Date
    Mar 2013
    Location
    Nasik, India
    Posts
    21

    Re: please help,how to scroll textArea in s40-with-theme

    Vikrant,

    Is it scrolling if you set it as focusable?
    Further instead of adding textArea directly to Form you can add it to Container which is scroll able and focus-able.
    And finally add that container to Form.

    Vishal.

  5. #5
    Registered User
    Join Date
    May 2009
    Location
    Guatemala
    Posts
    186

    Re: please help,how to scroll textArea in s40-with-theme

    Can you provide more details? maybe an image of your form?

    Since the text you are assigning to the TextArea is pretty short, and you talk about "scrolling" I suppose there are other objects in the form, and it could be important to know it. Also, we don't know the size of "middlecomponentHT", which you are using to set the preferred height.

    Also, I don't see where you are setting the number of rows (SetRows) to at least two, so guess it would show as a single line text, and maybe you are talking about horizontal scrolling.

    Also, please let us know whether setting the object as focusable makes it scroll as you want (even though we know you can't leave it focusable).

    The more we have to guess, the more inaccurate our suggestions are probably going to be.
    -CarlosDL

  6. #6
    Registered User
    Join Date
    May 2013
    Posts
    153

    Re: please help,how to scroll textArea in s40-with-theme

    Thanks vishal,it is does not scrolling even after set it as focasable.And in my code it add textArea direct to not in container...Is there any issue if we add it direct to form???

  7. #7
    Registered User
    Join Date
    May 2013
    Posts
    153

    Re: please help,how to scroll textArea in s40-with-theme

    i set the hight of textArea percentage of hight of form.i set the height
    int middlecomponentHT=formHT*60/100
    thoughttext.setPreferredH(middlecomponentHT);
    and my resolution is 240 x 400
    http://i.imgur.com/1tI0cH9.png
    i sending the image of my textArea at form .we added TextArea direct to form not throught container because when we add textArea in container and set the container in center of border layout.
    and when i set textArea in container at center position of form set border layout in form it set EAST position i sending the image
    http://imgur.com/JLbJHn3
    please help me
    Thanks

  8. #8
    Registered User
    Join Date
    Mar 2013
    Location
    Nasik, India
    Posts
    21

    Re: please help,how to scroll textArea in s40-with-theme

    Seems like there is some other issues as it is not scrolling even if its set as focusable, though give a try to below things.

    1) Set below textarea properties. and form scrolling to true. And check whether it is scrolling after gaining focus. (Add text area directly to form)

    textarea.setEditable(false);
    textarea.setFocusable(true);


    2) Add text area to container with all above mentioned properties.
    Try with some other layout. Box_Y or default layout (i.e. flow layout)


    Thanks.
    Vishal

  9. #9
    Registered User
    Join Date
    May 2013
    Posts
    153

    Re: please help,how to scroll textArea in s40-with-theme

    Thanks vishal, i create a demo project of textArea i am sending the complete code to you so please check it
    Code:
    Display.init(this);
    		Display.getInstance().setForceFullScreen(true);
    		Form form=new Form();
    		form.setScrollable(false);
    		form.getUnselectedStyle().setBgColor(10175989);
    		form.setLayout(new BorderLayout());
    		Container northcon=new Container();
    		int northcomponentHT=form.getPreferredH()*20/100;
    		northcon.setPreferredH(northcomponentHT);
    		Label northlab=new Label("NORTH");
    		northcon.addComponent(northlab);
    		form.addComponent(BorderLayout.NORTH,northcon);
    		Container centercon=new Container();
    		TextArea textarea=new TextArea();
    		int centercomponentHT=form.getPreferredH()*60/100;
    		textarea.setPreferredH(centercomponentHT);
    		textarea.setPreferredW(form.getPreferredW());
    		String string=new String("dfjjkfjknfsdfhkfjfjcannot be surpassed by that of watching electric lights. Everyone in Gods creation is special and so are wcannot be surpassed by that of watching electric lights. Everyone in Gods creation is special and so are wcannot be surpassed by that of watching electric lights. Everyone in Gods creation is special and so are wcannot be surpassed by that of watching electric lights. Everyone in Gods creation is special and so are wcannot be surpassed by that of watching electric lights. Everyone in Gods creation is special and so are wcannot be surpassed by that of watching electric lights. Everyone in Gods creation is special and so are wcannot be surpassed by that of watching electric lights. Everyone in Gods creation is special and so are wkfiufjkfjkfjfjkfjierojfkjjiojkldf;jasf;ljsf;jl;dfjas;dflk;lfj;asdfljsdl;fkjierojeiorjoiejkfjoeirjjeoirjoejo;efdfkljoijerjorj");
    		textarea.setScrollVisible(true);
    		textarea.setScrollOpacityChangeSpeed(5);
    		textarea.setText(string);
    		textarea.setEditable(false);
    		textarea.setGrowByContent(true);
    		textarea.setRows(50);
    		
    		//centercon.setScrollable(true);
    		centercon.addComponent(textarea);
    		
    		form.addComponent(BorderLayout.CENTER,centercon);
    		Container southcon=new Container();
    		int southcomponentHT=form.getPreferredH()*20/100;
    		southcon.setPreferredH(southcomponentHT);
    		Label southlab=new Label("SOUTH");
    		southcon.addComponent(southlab);
    		form.addComponent(BorderLayout.SOUTH,southcon);
    		form.show();
    and sending the link of snapshot
    http://i.imgur.com/Ah3UQUG.png
    now please help me

  10. #10
    Registered User
    Join Date
    May 2013
    Posts
    153

    Re: please help,how to scroll textArea in s40-with-theme

    Any body please help me how can make textArea scrollable
    Thanks

  11. #11
    Registered User
    Join Date
    Mar 2013
    Location
    Nasik, India
    Posts
    21

    Re: please help,how to scroll textArea in s40-with-theme

    Hi Vikrant,

    I have just tried the code given by you and it is working fine on several emulators (Touch/Non Toch)
    Am not able to use below line of code given by you because my LWUIT ver 1.5 does not support it. (Am not sure about it).
    Display.getInstance().setForceFullScreen(true);

    Further i have not using any theme so you can check the theme properties if you are using any.

    Thanks,
    Vishal.

  12. #12
    Registered User
    Join Date
    May 2013
    Posts
    153

    Re: please help,how to scroll textArea in s40-with-theme

    Thanks,I know that it working properly in lwuit1.5 but i am using gestrue class in my application.it use it form the following linkhttp://developer.nokia.com/Community...meAnimator_API
    this is not in lwuit 1.5.
    so how can i use it in lwuit1.5 if i use it in my project please suggest me
    Last edited by vikranttanwar@; 2013-10-25 at 11:35.

  13. #13
    Registered User
    Join Date
    May 2013
    Posts
    153

    Re: please help,how to scroll textArea in s40-with-theme

    Please tell me ,According to my requirment i can't use lwuit 1.5 in which textArea scrollable so please suggest me which api i have to use.there is many jar file like s40-without theme ,full touch so which api i have to use for use the gesture funcionality

  14. #14
    Regular Contributor
    Join Date
    Dec 2012
    Location
    India
    Posts
    266

    Re: please help,how to scroll textArea in s40-with-theme

    I think you can imitate gestures in a different way.Although its not the most efficient solution, you can try using a horizontal list in LWUIT 1.5. Another method could be to override pointer dragged method for the form.Let me know if it helps.

Similar Threads

  1. Lwuit how to make textarea scroll by page
    By Youssef77 in forum Mobile Java UI and User Experience
    Replies: 4
    Last Post: 2013-08-31, 16:39
  2. how to scroll the textarea of lwuit in S40_with_theme
    By vikranttanwar@ in forum Mobile Java UI and User Experience
    Replies: 7
    Last Post: 2013-08-29, 07:44
  3. TextArea won't scroll
    By KimF in forum Nokia N9
    Replies: 1
    Last Post: 2012-01-08, 05:37
  4. Replies: 5
    Last Post: 2011-02-03, 14:07

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •