×

Discussion Board

Results 1 to 8 of 8

Thread: Button Problems

  1. #1
    Registered User
    Join Date
    Feb 2010
    Posts
    3

    Button Problems

    I develop a small app for a Nokia 6212! My Problem is, I need Buttons in the Application. I`ve tried it with the Command options, but I don't like the style of it. I want to costumize it. Is there any other chance to make some kind of Buttons? Anything similar to the Java Buttons?

    I need to place the Buttons at special coordinates on the screen. And how do I navigate to those Buttons?

    Please help me.

    Michi

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Button Problems

    There is no such thing in MIDP; there is nothing similar to AWT or Swing, for example. Your options are:

    1. Use LCDUI, and live with it. It will work, and it will adapt to different devices (touch, non-touch, keyboard, keypad, different screen sizes, etc.) successfully, and will usually take on the style of the device's own UI.

    2. Build a custom UI using by subclassing Canvas. You will need to handle all the painting and input yourself, it will do nothing for you. There is no concept of "Components", unless you create one. A lot of work, especially if you want to support multiple devices.

    3. Use an off-the-shelf custom UI library, such as LWUIT. This is built as described above.

    Note that once you go down the custom route, you cannot mix LCDUI with custom UI libraries. You must do everything custom.

    Graham.

  3. #3
    Registered User
    Join Date
    Feb 2010
    Posts
    3

    Re: Button Problems

    Hey thanks for the answer.
    I want to build a app like this

    Code:
     ________________
    |                |
    |                |
    |      Text      |
    |      Text      |
    |                |
    |   ____  ____   |
    |  | OK || X  |  |
    |   ----  ----   |
    |                |
    ------------------
    I can draw two rectangles but my question is, how do I make them act like Buttons. I need to focus on one button by pressing the navigation key. (The Phone key which is used to navigate through the menu).

    How do I make this?
    Last edited by gimmecable; 2010-02-08 at 17:01.

  4. #4
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Button Problems

    Take a look at this example. It's for a menu, not a dialogue, but the principle is the same.

    Graham.

  5. #5
    Registered User
    Join Date
    Feb 2010
    Posts
    45

    Smile Re: Button Problems

    do the following
    Code:
    private Command exit,next;
    if u r using form or list the do the following for adding the command on screen and display them

    Code:
    private Form form;
    form=new Form("");
    exit=new Command("Exit",Command.Exit,1);
    next=new Command("Next",Command.Exit,1);
    form.addCommand(exit);
    form.addCommand(next);
    display.setCurrent(form);
    I hope u get it

  6. #6
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Button Problems

    Quote Originally Posted by dineshdreamworld View Post
    do the following
    Code:
    private Command exit,next;
    The original poster wrote:

    Quote Originally Posted by gimmecable View Post
    I`ve tried it with the Command options, but I don't like the style of it. I want to costumize it.
    You might save yourself some time if you read the thread before replying.

    Cheers,
    Graham.

  7. #7
    Registered User
    Join Date
    Feb 2010
    Posts
    45

    Re: Button Problems

    Sry i didn't noticed that. But thank for notifying me.

  8. #8
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    127

    Re: Button Problems

    Hi,
    Are you using form or canvas?
    If you are using form then you can use String item in this manner
    Code:
    	next = new StringItem("", "Next", StringItem.BUTTON);
    I think it may help you.

Similar Threads

  1. Avkon Toolbar Sliding Button
    By mike437 in forum Symbian User Interface
    Replies: 0
    Last Post: 2010-02-02, 12:12
  2. Nokia E62/E61 kill button
    By regis.melo in forum Mobile Java General
    Replies: 1
    Last Post: 2007-05-14, 17:55
  3. command button problem with s60 phones
    By jonneymendoza in forum Mobile Java Games
    Replies: 1
    Last Post: 2007-03-24, 05:33
  4. command button problem with s60 phones
    By jonneymendoza in forum Mobile Java General
    Replies: 1
    Last Post: 2007-03-23, 13:28
  5. problems with setDefaultCommand() on 6600
    By oezzi in forum Mobile Java General
    Replies: 0
    Last Post: 2004-01-22, 23:16

Posting Permissions

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