×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    May 2013
    Posts
    280

    Texarea is not getting scrolled when using pointer released event

    I m working on s40 app and using lwuit 1.5.

    I am using pointerPressed method and pointerReleased method of Textarea . When i used pointerPressed method my texarea was scrolling well but as soon as i used pointerReleased method along with it, textarea stopped scrolling.

    Here is my code :
    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);
       northlab=new Label("NORTH");
      northcon.addComponent(northlab);
      form.addComponent(BorderLayout.NORTH,northcon);
      Container centercon=new Container();
      TextArea textarea=new TextArea()
      /***********************************************/
     
        public void pointerPressed (int x, int y)
                 {
                  System.out.println("value of x in pressing ..."+x);
                  System.out.println("value of y in pressing......"+y);
                   
                  }
                 public void pointerReleased (int x, int y)
                  {
                   System.out.println("value of x in releasing ..."+x);
                   System.out.println("value of y in releasing......"+y);
                    
                   }
                 
              };
      
      /*******************************************/
      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.setFocusable(true);
      textarea.requestFocus();
      textarea.setScrollVisible(true);
      textarea.setEditable(false);
      textarea.setText(string);
      textarea.setRows(50);
      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);
     /* GestureInteractiveZone gest = new GestureInteractiveZone( GestureInteractiveZone.GESTURE_ALL);
      System.out.println("........................");
      //GestureRegistrationManager.register(new cantianer(), gest);
      //GestureRegistrationManager.setListener(new cantianer(), this);
      System.out.println("/////////////////////////////////");
      System.out.println("helo...................");*/
      form.show();
    I only used these to track pointer events.....
    Why is this happening?

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,748

    Re: Texarea is not getting scrolled when using pointer released event

    Try invoking the methods of the parent class
    Code:
    public void pointerPressed (int x, int y)
                 {
                  System.out.println("value of x in pressing ..."+x);
                  System.out.println("value of y in pressing......"+y);
                   super.pointerPressed(x,y);
                  }
                 public void pointerReleased (int x, int y)
                  {
                   System.out.println("value of x in releasing ..."+x);
                   System.out.println("value of y in releasing......"+y);
                   super.pointerReleased(x,y);
                   }
                 
              };

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

    Re: Texarea is not getting scrolled when using pointer released event

    Thanks wizard ...it worked

Similar Threads

  1. Lwuit Container, pointer released event
    By Javier Muñoz in forum Mobile Java General
    Replies: 2
    Last Post: 2013-07-09, 14:07
  2. Replies: 2
    Last Post: 2009-09-02, 10:25
  3. Pointer Event for S60
    By totooo in forum Mobile Java General
    Replies: 22
    Last Post: 2009-06-12, 16:13
  4. How can I simulate the pointer event?
    By xiaohua.hou in forum Symbian
    Replies: 11
    Last Post: 2008-11-14, 02:56
  5. how to capture pointer event?
    By h_01cs25 in forum General Development Questions
    Replies: 0
    Last Post: 2006-03-30, 15:04

Posting Permissions

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