×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Nov 2009
    Posts
    5

    J2ME Touch Button

    Hi,

    I will like to create J2ME touch buttons. I have created a rectangle canvas and will like to use the coordinates to fire the event. Appreciate if you can post some codes or links to help.

    Thanks,

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

    Re: J2ME Touch Button


  3. #3
    Registered User
    Join Date
    Nov 2009
    Posts
    5

    Re: J2ME Touch Button

    not really. I will like to have two touchable buttons (no tactile) and each button will go to the next page. But this is a wonderful url. I will keep researching

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

    Re: J2ME Touch Button

    You can also ref. to this code example: http://wiki.forum.nokia.com/index.ph..._Touch_Devices

    Making complete keyboard on Canvas that works with touch.

    thanks,
    ~Amitabh

  5. #5
    Registered User
    Join Date
    Nov 2009
    Posts
    5

    Re: J2ME Touch Button

    Guys, Thanks for your help. I am understanding this better now.

    I have to use CustomItem to create the button so that it calls on the 'button'. I have create two customitem but how can l make each customitem run its own function when pressed?

    Example: When C1 is pressed, it runs function A, and when C2 is pressed, it runs a separate function?

    attach codes
    form = new Form("CustomItemMIDletExample");
    exit = new Command("Exit", Command.EXIT, 0);

    CustomItemExample C1 = new CustomItemExample("Enter");
    form.append(C1);

    CustomItemExample C2 = new CustomItemExample("Exit");
    form.append(C2);

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

    Re: J2ME Touch Button

    are you cgonna useCommands ?
    then u need the Commandlistener interface...

  7. #7
    Registered User
    Join Date
    Nov 2009
    Posts
    5

    Re: J2ME Touch Button

    i want to use two touch buttons. not using the left and right soft keys.

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

    Re: J2ME Touch Button

    well then you will have to use your own logic..
    The link I posted is still usable, in that code you can see how to react on an user actually pressing on your canvas...
    then you take the coordinates of this "click", check if they are within the boundaries of one of your buttons and act according to that...

    That means you can create your own customItem (which has it's own canvas if I'm not mistaken) and use the above to implement your two buttons and act on any of those being pressed...

    May I ask what you mean with "I will like to have two touchable buttons (no tactile)" ?
    Tactile is another word for touch...

Similar Threads

  1. how to use the touch ui in j2me
    By junaid888 in forum Mobile Java General
    Replies: 8
    Last Post: 2010-12-30, 11:31
  2. Need to use J2ME Polish framework
    By yatin.frankline in forum Mobile Java General
    Replies: 1
    Last Post: 2010-04-07, 11:46
  3. Can I create an application to auto press key button by J2ME
    By WerA in forum Mobile Java Media (Graphics & Sounds)
    Replies: 6
    Last Post: 2010-02-24, 14:26
  4. Disable Menu Button Using J2ME
    By jaceline in forum Mobile Java General
    Replies: 5
    Last Post: 2006-04-25, 16:42
  5. New to J2ME
    By onelife511 in forum Mobile Java General
    Replies: 5
    Last Post: 2006-01-28, 19:46

Posting Permissions

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