×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Regular Contributor
    Join Date
    Mar 2010
    Posts
    136

    buttons in MIDlet

    Can we use buttons in J2me MIDlet?
    As far as I have read, we can use only commands as buttons.
    And we can not say exactly where that commands will appear on the scree.
    Is that right?
    Last edited by komomo; 2010-06-14 at 04:47.

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

    Re: buttons in MIDlet

    yup,
    thats the short version, you can use priorities for the placement of the COmmands, but those are more an advise or a request from the developer, in the end the underlying OS will decide if the Commands will be arranged as the supplied priorities or not... most of the time it's not unfortunately
    To have more control you might want to use a 3rd party gui library, like LWUIT or J2ME Polish...

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

    Re: buttons in MIDlet

    Quote Originally Posted by komomo View Post
    Can we use buttons in J2me MIDlet?
    As far as I have read, we can use only commands as buttons.
    And we can not say exactly where that commands will appear on the scree.
    Is that right?
    As Tiger suggested, use 3rd party gui library, like LWUIT or J2ME Polish... to get buttons or make your own CustomItem as a Button or go full Canvas and define/draw on screen buttons any where and handle user events - keypress or pointere press on the button and perform you own needed action.
    Thanks,
    Ekta

  4. #4
    Regular Contributor
    Join Date
    Mar 2005
    Location
    Hamburg, Germany
    Posts
    284

    Re: buttons in MIDlet

    You can use a StringItem as a button.
    You need to give it the appearance mode Item.BUTTON
    Then you can assign a command and a command listener, and add it to your form.
    It is described in the MIPD-API of the second StringItem constructor.

    Or you can use an ImageItem as Button. This works like a StringItem.

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

    Re: buttons in MIDlet

    Adding buttons using StringItem or ImageItem, you will have constrain of keeping only 1 button in a row on the screen.
    If you need mutiple buttons in row use some third party UI libs like LWUIT which gives you more control on placement of these buttons. Or create you own Custom Item with two buttons.
    Thanks,
    Ekta

  6. #6
    Super Contributor
    Join Date
    Sep 2008
    Location
    Noida, U.P.
    Posts
    1,330

    Re: buttons in MIDlet

    Quote Originally Posted by komomo View Post
    Can we use buttons in J2me MIDlet?
    As far as I have read, we can use only commands as buttons.
    And we can not say exactly where that commands will appear on the scree.
    Is that right?
    Hi,

    Yes Buttons in JavaMe tends to Commands and also by setting priority we can define the order of Commands. Please check the constructor of Command .. The third param tends to priority. If you want the location of buttons or command at anywhere on the screen then you can use Canvas for the same.
    thanks,
    jitu_goldie..

    KEEP TRYING..

Similar Threads

  1. Buttons
    By nair.shanker in forum Symbian User Interface
    Replies: 4
    Last Post: 2008-06-30, 12:55
  2. Buttons
    By arunpirku in forum Symbian User Interface
    Replies: 0
    Last Post: 2005-03-31, 11:29
  3. I need two buttons!
    By caglarkumanli in forum Symbian User Interface
    Replies: 1
    Last Post: 2004-10-16, 14:03
  4. buttons?
    By kurtrips in forum Symbian
    Replies: 1
    Last Post: 2004-07-28, 14:49
  5. buttons
    By titch_stewart in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2003-04-17, 08:39

Posting Permissions

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