×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Regular Contributor
    Join Date
    Aug 2005
    Location
    Venice, California
    Posts
    67

    Question J2ME addCommand() Softkey Assignment

    I am having difficulty placing "Ok" and "Erase" buttons on the softkeys in a J2ME MIDlet. "Options" and "Erase" are generated instead.

    "Ok" and an unwanted "Exit" item appear inside the unwanted "Options" menu. I do not want the "Exit" item at all (exits the app).

    This behavior occurs when I addCommand()s to a the displayables Form, Canvas, or Alert. I tried various Command.TYPES and priorities with same result. I have tested on Nokia 6620 and Nokia 6682 handsets.

    How do I place "Ok" on the LSK instead of an "Options" menu?

    Here is a code snipet:

    class myCanvas extends Canvas {
    public myCanvas() {
    super();
    Command cmdOK = new Command("Ok", "Send to Server...", Command.OK, 2);
    Command cmdCancel = new Command("Erase", Command.BACK, 2);
    addCommand(cmdOK);
    addCommand(cmdCancel);
    }
    ...
    }

    Note: This code is not exact, only an example.

    Thank you very much for your advice.

    - Sincerely, David Manpearl
    Last edited by davidmanpearl; 2006-01-27 at 17:40.

  2. #2
    Regular Contributor
    Join Date
    Jun 2003
    Location
    Hungary
    Posts
    414

    Re: J2ME addCommand() Softkey Assignment

    The system automatically adds the Exit command on S60 devices, you can't get rid of that. The Ok or Erase will appear under the options menu (because you have 3 commands for 2 softkey). The only thing you can manage is which command stay alone.

  3. #3
    Nokia Developer Expert
    Join Date
    Jun 2005
    Posts
    923

    Re: J2ME addCommand() Softkey Assignment

    The unwanted Exit command does not appear on Series 40 and Series 60 (from Feature Pack 3 and above).

    With the previous versions of Series 60, kisember is right, you can't get rid of the Exit command.

    Daniel

  4. #4
    Regular Contributor
    Join Date
    Aug 2005
    Location
    Venice, California
    Posts
    67

    Re: J2ME addCommand() Softkey Assignment

    I have verified that my devices are FP2.
    Still looking...

  5. #5
    Regular Contributor
    Join Date
    Jan 2006
    Posts
    90

    Re: J2ME addCommand() Softkey Assignment

    Hi all
    I'm facing the same problem. i'm using Nokia Prototype_4_0_S60_MIDP_Emulator.
    Is it possible to interchange the positions of OK and Back Commands.
    Thanks in advance

  6. #6
    Regular Contributor
    Join Date
    Mar 2005
    Posts
    249

    Re: J2ME addCommand() Softkey Assignment

    But for the most part, where the commands appear is device dependent because some phones have 3 soft keys, some have 2, and some S60s have an EXIT command which cannot be removed.

    The best you can do is to play around with the Priorities of commands, which generally affects which command comes up first on the Menu.

    You can always "confuse" the system into mapping commands to softkeys though.... (some devices, not all, have inbuilt mappings of soft keys, like Command.EXIT will always get the right soft key for example) by making your Exit Command type Command.OK, and making the OK command Command.EXIT.

    However, I wouldn't reccommend this. There's a known issue with the 6600 at least, where you cannot change the label of Command.EXIT. It will always say EXIT no matter what you pass it.

  7. #7
    Registered User
    Join Date
    Jan 2007
    Posts
    6

    Re: J2ME addCommand() Softkey Assignment

    Hi!

    I have a similar problem on my S40 (6230i to be more exact):
    Even if I only add one command with type Command.OK, it creates an "Option" menu with one entry.
    Very annoying.

    Is there some setting to change this ?
    Thanks and Regards,
    Markus

  8. #8
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: J2ME addCommand() Softkey Assignment

    Basically it is up to system how the commands are displayed. You do not have any control over that. You could of course try out how the other Command types behave, but I do not think that you will get rid of this behavior. If you want greated control, you could implement your UI using low-level API.

    Hartti

Similar Threads

  1. How can the WAP browser communicate to J2ME application?
    By hbfornies in forum Mobile Java General
    Replies: 20
    Last Post: 2007-03-02, 16:32
  2. J2ME Polish Version 1.0 RC6
    By enough in forum Mobile Java General
    Replies: 1
    Last Post: 2004-07-20, 11:25
  3. J2ME Polish 1.0 RC1!
    By enough in forum Mobile Java General
    Replies: 1
    Last Post: 2004-06-15, 02:53
  4. TinyLine SVG Minute Toolkit: Optimizing SVG for J2ME
    By girow in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2003-05-05, 18:44
  5. TinyLine SVG Minute Toolkit for J2ME: version 1.4 released
    By girow in forum Mobile Java General
    Replies: 0
    Last Post: 2003-05-05, 16: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
  •  
×