×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Registered User
    Join Date
    Oct 2009
    Posts
    15

    Question how to adda command to textArea ??

    I have form that contains textArea i need to add command and command listener to it
    Mid-let accept the code but no thing appear not the command neither the listener

    here is my code:
    textArea= new TextArea(5, 20, TextArea.ANY);
    textArea.setEditable(true);
    textArea.getStyle().setBgTransparency(50);
    textArea.addActionListener(new ActionListener() {
    com.sun.lwuit.Command c= new com.sun.lwuit.Command("send", 0) ;
    public void actionPerformed(ActionEvent ae) {
    sendSMS("123456", textArea.getText()); //sendSMS("123456", textArea.getText());
    }
    });
    ???

  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,087

    Re: how to adda command to textArea ??

    You have not added the command c to the form or textArea, you have just created it so its not visible.

    thanks,
    ~Amitabh

  3. #3
    Registered User
    Join Date
    Oct 2009
    Posts
    15

    Exclamation Re: how to adda command to textArea ??

    Quote Originally Posted by im2amit View Post
    You have not added the command c to the form or textArea, you have just created it so its not visible.

    thanks,
    ~Amitabh
    how to do so
    i cannot find textArea.addCommand ??
    i wanna add the command to the textArea not the form (ie to send msg within the textarea without navigating out to the main form)after i add the listener it do send sms but without a button -Appear- to press in its menu !!
    or shall i make a new form with textfield or can i customize the textArea ??

    and how to re-size button or a label in the com.sun.lwuit API ??
    because form style ( f.setLayout(new GridLayout(4, 1)))make all the same size
    Last edited by ahmedcse; 2010-04-25 at 10:48.

  4. #4
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Re: how to adda command to textArea ??

    you cannot customize a High Level GUI component really, at leats not it;s looks..
    What you could do though is create a CustomItem object, which is like a small Canvas which can be placed on a Form...
    A short introduction can be found here :
    http://developers.sun.com/mobility/m...ps/customitem/

  5. #5
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,087

    Re: how to adda command to textArea ??

    All HighLevel Components provided by LWUIT are highly customizeable, and you can change the look and feel of each of them to the extent that you can even overwrite paint() method to give it complete new look.

    Read LWUIT demo and online documentations on java.net

    thanks,
    ~Amitabh

  6. #6
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Re: how to adda command to textArea ??

    eehhrrmm..
    Afaik LWUIT wasn't mentioned by the topic starter ?
    Also take into account that the LWUIT "High Level" components aren't really High Level MIDP components, those are just Canvases afaik... That's also why they are so highly customizable

  7. #7
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,087

    Re: how to adda command to textArea ??

    I got LWUIT from the line below, in the starter thread:

    com.sun.lwuit.Command c= new com.sun.lwuit.Command("send", 0);

    and also MIDP does't have any TextArea component

    thus I replied w.r.t. to LWUIT only.

    thanks,
    ~Amitabh

  8. #8
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Re: how to adda command to textArea ??

    you are completely right,
    didn't notice the LWUIT import at all...
    Still I woulnd't call it a high level gui component, simply because it is based on a low level gui componetn within MIDP :P

  9. #9
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,087

    Re: how to adda command to textArea ??

    Yes you are correct Tiger, we should not call them (LWUIT TextArea) HighLevel, thou they provide the features and easy similar to MIDP Highlevel components but the implementation of these is based on Canvas, which make them lowlevel.

    Any idea how MIDP highlevel components are rendered on the screen?

    thanks,
    ~Amitabh

  10. #10
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Re: how to adda command to textArea ??

    No idea actually, might be through OS calls ?
    If im not mistaken there was some kind of open-MIDP project, no idea if that was/is the official source-code but you could have a look at that...

    https://phoneme.dev.java.net/downloads_page.html

    Actually I found the source code :
    https://phoneme.dev.java.net/source/...edition/lcdui/

    And if im not mistaken that example regarding the CustomItem states that the methods which you have to inherit are also part of the other High Level gui components...
    Last edited by Tiger79; 2010-04-26 at 14:23.

Similar Threads

  1. LWUIT TextArea Problem
    By zzwei in forum Mobile Java General
    Replies: 4
    Last Post: 2012-09-20, 10:12
  2. Replies: 6
    Last Post: 2010-01-25, 19:47
  3. Widgets flicker on textfield and textarea blur
    By JimBroad in forum Symbian
    Replies: 1
    Last Post: 2009-11-20, 13:01
  4. textarea cols and width of picture?
    By badtant in forum Browsing and Mark-ups
    Replies: 0
    Last Post: 2006-04-11, 13:09
  5. Is TextArea included in MIDP ?
    By akokchai in forum Mobile Java General
    Replies: 2
    Last Post: 2003-06-02, 04:25

Posting Permissions

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