×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Feb 2013
    Location
    Madrid
    Posts
    84

    Question Catch events from TextArea

    I'm building my app using the Nokia SDK 1.0 for the Asha 501

    What I want to know, is how to capture events by pressing a TextArea. I'm porting an app from the S40 and using the code below, the TextArea doesn't capture the events

    Code:
    TextArea itemText = new TextArea("Hello I'm a TextArea", 2, 22) {
    
                public void pointerPressed(int x, int y) {
                    System.out.println("PRESSED");
                }          
                
                public void pointerReleased(int x, int y) {
                    System.out.println("HI!");
                    
                }
            };
            itemText.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent ae) {
                    System.out.println("HI");
                }
            });
            itemText.setEditable(false);
            itemText.setFocusable(false);
            itemText.getStyle().setBorder(null);
            itemText.getStyle().setFgColor(Constants.Style.Color.GREY_DATE);
            itemText.getStyle().setBgTransparency(Constants.Style.TRANSPARENT);
            itemText.getStyle().setFont(Font.createSystemFont(Font.FACE_SYSTEM, Font.STYLE_PLAIN, Font.SIZE_SMALL));
    Any idea?

  2. #2
    Regular Contributor
    Join Date
    Dec 2012
    Location
    India
    Posts
    271

    Re: Catch events from TextArea

    Try removing this line :

    itemText.setFocusable(false);

  3. #3
    Registered User
    Join Date
    Feb 2013
    Location
    Madrid
    Posts
    84

    Re: Catch events from TextArea

    Quote Originally Posted by arunkam View Post
    Try removing this line :

    itemText.setFocusable(false);
    No, without this line, the TextArea still not catching the pointer event.

    In Nokia SDK 2.0 this code is working

  4. #4
    Registered User
    Join Date
    Feb 2013
    Location
    Madrid
    Posts
    84

    Re: Catch events from TextArea

    I've finally found what is the problem, I don't know the reason why but that's it.

    Removing this line

    itemText.setEditable(false);

    the TextArea catches the events.

    I don't find the reason that in Nokia SDK 2.0 this code is working and why here is not. Ande there is another fact. I set the TextAreato editable, and it is not editable o_O

  5. #5
    Regular Contributor
    Join Date
    Dec 2012
    Location
    India
    Posts
    271

    Re: Catch events from TextArea

    I am guessing that this behaviour is because you are overriding the pointer pressed method.By default , the Virtual Keyboard(VKB) is made to show whenever that happens.You have overridden that, hence nothing is showing up.

Similar Threads

  1. Catch touch events in Container
    By minirich in forum Mobile Java UI and User Experience
    Replies: 2
    Last Post: 2013-09-17, 20:07
  2. how to catch and stor events in a file
    By bravvve in forum Symbian
    Replies: 2
    Last Post: 2009-06-26, 03:22
  3. Catch menu events with a Fep application
    By stefano.garusi in forum Symbian
    Replies: 5
    Last Post: 2008-11-11, 06:36
  4. Easy way to catch Events
    By Capatain Future in forum Symbian
    Replies: 1
    Last Post: 2006-03-28, 04:04
  5. How catch all system events?
    By wu_genqing in forum Symbian
    Replies: 1
    Last Post: 2003-05-15, 15:35

Posting Permissions

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