×

Discussion Board

Results 1 to 13 of 13
  1. #1
    Registered User
    Join Date
    Jun 2009
    Posts
    35

    how to add first command on right and others in left in LWUIT

    Hi all

    when i am adding a command on a form in LWUIT then it is by default added on left side and then other commands are going on the right side.
    can any body tell me how to add first command on right side and other commands on the left side?

    for eg. exit or back on right side and other commands on the left side.

    thanks
    manish

  2. #2
    Nokia Developer Champion
    Join Date
    Apr 2007
    Posts
    2,708

    Re: how to add first command on right and others in left in LWUIT

    you simpl can't with the standard Command high level items...
    You can give them a priority, but that will be like a suggestion to the OS how you as a developer would like to see your Commands placed, but in the end it will be the underlying OS which will devide how they will be placed...
    A solution would be to create your own buttons in Canvas or otherwise use a 3rd party GUI library like LWUIT or J2ME Polish....
    Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them.

  3. #3
    Registered User
    Join Date
    Jun 2009
    Posts
    35

    Re: how to add first command on right and others in left in LWUIT

    i am asking this for lwuit not for high level or canvas.

    thanks
    manish

  4. #4
    Registered User
    Join Date
    Oct 2009
    Location
    Noida
    Posts
    941

    Re: how to add first command on right and others in left in LWUIT

    @Tiger -- Manish has asked the Question with respect to LWUIT only, not MIDP.

    Quote Originally Posted by Manish_Bansal View Post
    Hi all

    when i am adding a command on a form in LWUIT then it is by default added on left side and then other commands are going on the right side.
    can any body tell me how to add first command on right side and other commands on the left side?

    for eg. exit or back on right side and other commands on the left side.

    thanks
    manish
    You can try Look&feel.setReverseSoftButtons(true); for this.
    Thanks,
    Ekta

  5. #5
    Nokia Developer Champion
    Join Date
    Apr 2007
    Posts
    2,708

    Re: how to add first command on right and others in left in LWUIT

    sorry this used to be a plain j2me forum, getting more and more LWUIT questions which actually has nothing to do with Nokia... I guess thats what the LWUIT forum exists for...
    Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them.

  6. #6
    Registered User
    Join Date
    Jun 2009
    Posts
    35

    Re: how to add first command on right and others in left in LWUIT

    can you tell me which lwuit would be best for my questions?

  7. #7
    Registered User
    Join Date
    Oct 2009
    Location
    Noida
    Posts
    941

    Re: how to add first command on right and others in left in LWUIT

    Quote Originally Posted by Manish_Bansal View Post
    can you tell me which lwuit would be best for my questions?
    This feature Look&feel.setReverseSoftButtons(true) exist in all version of LWUIT, you should take latest public release JAR from LWUIT website.
    Thanks,
    Ekta

  8. #8
    Registered User
    Join Date
    Jun 2009
    Posts
    35

    Re: how to add first command on right and others in left in LWUIT

    thanks ektasrv........ my problem got solved...

  9. #9
    Regular Contributor
    Join Date
    Jul 2010
    Posts
    178

    Re: how to add first command on right and others in left in LWUIT

    Hi Manish
    Could you tell me.How you solved the problem?
    I have used command button like this
    view.addCommand(new Command("Exit") {
    public void actionPerformed(ActionEvent evt) {
    ite.show();
    }
    });

    I need two soft keys "Exit" on right side and "option" on left side
    "option" contains Following things "add" and "view"

    Please provide a solution
    That would be helpful for me.
    THANKS

  10. #10
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,073

    Re: how to add first command on right and others in left in LWUIT

    In LWUIT you can use addCommand to add mutiple commands like Exit, Add and View and you will see LWUIT automatically does this that the first added Command comes on one soft key and rest others are clubbed together in an options menu.
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

  11. #11
    Regular Contributor
    Join Date
    Jul 2010
    Posts
    178

    Re: how to add first command on right and others in left in LWUIT

    Hi im2amit
    Thanks for reply.

    I Displayed student marks in List
    l.addItem("Computer Graphics:75");
    l.addItem("Computer Algorithm:82");
    ..
    l.addItem("Total:462");

    I want to Hi light the Total as bold or some colored text
    Is this possible in List using LWUIT?
    Please tell me .
    Last edited by senthil_25; 2010-08-17 at 05:50.

  12. #12
    Registered User
    Join Date
    Dec 2009
    Location
    chennai
    Posts
    137

    Re: how to add first command on right and others in left in LWUIT

    Ya its possible. But table component is better for u. And If u want to show the bold and color text means u want to use ResourceEdit sel#font and Unsel#font like that.

    But if u need to show the mark list in List means u can use DefaultListCellRenderer class in ur List.

    see this link. it may b helps u.
    http://lwuit.blogspot.com/2008/07/lw...-fishbein.html
    Bharath... :)

  13. #13
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,073

    Re: how to add first command on right and others in left in LWUIT

    Quote Originally Posted by senthil_25 View Post
    Hi im2amit
    Thanks for reply.

    I Displayed student marks in List
    l.addItem("Computer Graphics:75");
    l.addItem("Computer Algorithm:82");
    ..
    l.addItem("Total:462");

    I want to Hi light the Total as bold or some colored text
    Is this possible in List using LWUIT?
    Please tell me .
    In your list Render, you will need to overwrite DefaultListCellRendere and check if it the last element of the list, where you are printing the total - change the font to bold and color to which ever you want.
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

Similar Threads

  1. Right-to-left languages with LWUIT
    By giaviv in forum Mobile Java General
    Replies: 3
    Last Post: 2010-09-28, 16:31
  2. add lwuit in eclipse
    By yatibawri in forum Mobile Java General
    Replies: 8
    Last Post: 2010-03-04, 12:05
  3. How to add a new item in contact's option menu (left softkey)
    By rahulkrishna in forum Mobile Java General
    Replies: 6
    Last Post: 2009-08-25, 11:31
  4. Displaying OK command directly on left softkey
    By simonru in forum Mobile Java General
    Replies: 5
    Last Post: 2005-09-07, 03:17
  5. how to add command in FullCanvas
    By ihadreampp in forum Mobile Java General
    Replies: 1
    Last Post: 2003-08-14, 07:32

Posting Permissions

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