×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Jul 2012
    Posts
    1

    Question [moved] Working of Imageitem in J2ME for Touch Handsets

    HI Team,

    Thanks in advance for reading and answering this post.

    We need the solution on an urgent basis. I have developed an app in j2me. In this, We created a class extended from "Form" and in that form we have added 3 imageitem. say :-

    Image button_prev = null;
    button_prev = Image.createImage("/1.png");

    btnPreview = new ImageItem(null, button_prev, ImageItem.LAYOUT_CENTER, "Preview");
    btnPreview.setItemCommandListener(this);
    btnPreview.addCommand(new Command("", 1, 2));
    append(btnPreview);

    and on commandaction we have written the code as we required like ....

    public void commandAction(Command cmnd, Item item) {
    ImageItem img_item = (ImageItem) item;
    System.out.println("home screen ::: "+img_item.getAltText());
    //req work here
    }

    now the problem is :- on keypad handsets the code is running fine. But when we run the same build on pure touch handsets, and when we touch on the imagebutton nothing happend. I have tested the same build on nokia x6 and on nokia asha 311. When tested on x6, we have notice that in that form , a select button comes. when we touch on any of imageitem nothing happend but when touch on "select", its working. But on nokia asha 311 , no select button appears and we are unable to go inside as touch on imageitem is not working. Can you please tell us what we should do , so that whenever we touch on any of imageitem (3 imageitems that we have appended in form) it gets work accordingly. As we know that in j2me all high level component should work automatically on touch handsets as well. No need to write any code but why it is not working.

  2. #2
    Super Contributor
    Join Date
    Nov 2007
    Location
    Sertaozinho/Brazil
    Posts
    768

    Re: [moved] Working of Imageitem in J2ME for Touch Handsets

    Hi lalan.pooja

    I think "setDefaultCommand" is missing ...

    Code:
    btnPreview = new ImageItem(null, button_prev, ImageItem.LAYOUT_CENTER, "Preview");
    btnPreview.setItemCommandListener(this);
    Command cmd = new Command("", 1, 2);
    btnPreview.addCommand(cmd);
    btnPreview.setDefaultCommand(cmd); // missing
    append(btnPreview);
    Marcelo

  3. #3
    Nokia Developer Champion
    Join Date
    Mar 2003
    Posts
    4,104

    Re: [moved] Working of Imageitem in J2ME for Touch Handsets


  4. #4
    Registered User
    Join Date
    Apr 2013
    Posts
    12

    Re: [moved] Working of Imageitem in J2ME for Touch Handsets

    I think that this is related.

Similar Threads

  1. J2ME Polish Error On ImageItem, Please help
    By meghraj37 in forum Mobile Java General
    Replies: 2
    Last Post: 2012-06-15, 23:08
  2. Replies: 2
    Last Post: 2012-03-26, 10:10
  3. J2me application for Touch/Non Touch devices
    By shail@java in forum Mobile Java General
    Replies: 1
    Last Post: 2011-11-15, 09:02
  4. [moved]Doubt related J2ME Application In Nokia 5230 Touch Screen Mobile
    By sjafarhussain in forum Mobile Java Networking & Messaging & Security
    Replies: 3
    Last Post: 2011-11-04, 16:28
  5. How to browse images on touch screen handsets and convetional ones?
    By supriyaakg in forum [Archived] Flash Lite on Nokia Devices
    Replies: 10
    Last Post: 2010-12-28, 03:51

Posting Permissions

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