Discussion Board

Results 1 to 7 of 7
  1. #1
    Regular Contributor jselvakumar26071988's Avatar
    Join Date
    Sep 2008
    Posts
    158
    /*
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    */

    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;

    /**
    * @author selvakumar
    */
    public class item_demo extends MIDlet implements ItemCommandListener{
    Display display;
    Form form;
    Form mainform;
    Command back;
    Command cmd;
    Command click;

    ImageItem it;
    Image img;
    public item_demo()
    {
    form=new Form("hello") ;
    mainform=new Form("form2");

    cmd=new Command("simply",Command.OK,1);
    click=new Command("click",Command.OK,1);
    back=new Command("BACK",Command.OK,1);

    form.addCommand(click);

    mainform.addCommand(back);
    try{
    img=Image.createImage("untitled.png");
    it=new ImageItem(null,img,ImageItem.LAYOUT_CENTER,null,ImageItem.PLAIN);
    form.append(it);
    it.setDefaultCommand(cmd);
    it.setItemCommandListener(this);

    }
    catch(Exception e)
    {

    }


    }
    public void startApp() {
    display=Display.getDisplay(this);
    display.setCurrent(form);
    }

    public void pauseApp() {
    }

    public void destroyApp(boolean unconditional) {
    }

    public void commandAction(Command c, Item d)
    {
    if(c==cmd)
    {
    display.setCurrent(mainform);
    mainform.append("gud morg");
    }
    else if(c==back)
    {
    display.setCurrent(form);
    }

    }
    }

  2. #2
    Regular Contributor jselvakumar26071988's Avatar
    Join Date
    Sep 2008
    Posts
    158
    not able to view the image

  3. #3
    Nokia Developer Moderator bogdan.galiceanu's Avatar
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471
    That's strange... I tried your code and it worked. I saw the image in the first form, clicked on "simply" and was taken to the second form which had the words "gud morg".

  4. #4
    Registered User rahulsingh165's Avatar
    Join Date
    Sep 2008
    Posts
    4
    Quote Originally Posted by jselvakumar26071988 View Post
    not able to view the image
    Seems to work for me also. May be its a problem for specific model.

  5. #5
    Regular Contributor jselvakumar26071988's Avatar
    Join Date
    Sep 2008
    Posts
    158
    image is located under \src\.......
    is dat correct?
    not able to c de image....

  6. #6
    Nokia Developer Moderator bogdan.galiceanu's Avatar
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471
    Quote Originally Posted by jselvakumar26071988 View Post
    image is located under \src\.......
    is dat correct?
    not able to c de image....
    Yes. That's where it's supposed to be. I tried your exact code with the image in the src folder and it worked.

  7. #7
    Regular Contributor snehalpatil's Avatar
    Join Date
    Feb 2008
    Posts
    174
    i got a same problem ..convert image or if possible change it..it may be corrupted

Similar Threads

  1. Browser prob
    By Dearjee in forum Mobile Web Site Development
    Replies: 1
    Last Post: 2008-07-13, 17:03
  2. CommandListener / ItemCommandListener problem
    By marshallarts in forum Mobile Java General
    Replies: 0
    Last Post: 2005-06-16, 03:33
  3. Series 80 file handling prob
    By vaibhavsh83 in forum Mobile Java General
    Replies: 0
    Last Post: 2005-04-11, 14:34
  4. DKU-2 prob or pc suite?
    By eugene_kee in forum Symbian C++
    Replies: 2
    Last Post: 2004-08-02, 16:12
  5. prob in downloading jar file in 7650
    By ajay_sipl in forum WAP Servers
    Replies: 2
    Last Post: 2002-08-21, 09:03

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved