Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Missing something: J2ME ImageCreate

  • 10-04-2008 11:29PM
    #1
    Registered Users, Registered Users 2 Posts: 1,183 ✭✭✭


    Hi folks,

    I'm trying to write an application for my phone with j2me, first time trying.
    Everything is ok except I cannot get one part to work. I just want to display an existing image on screen. There are lots of examples on the net for the code, but they all just reference the pic as being (/whatever.png"). I've put my image in the same file as my jar file, and tested but I am still not getting it to work.
    try {
    
        ImageItem testImage = new ImageItem
          ("Test Image", Image.createImage ("/testImage.png"),
           ImageItem.LAYOUT_CENTER | ImageItem.LAYOUT_NEWLINE_BEFORE
           | ImageItem.LAYOUT_NEWLINE_AFTER, "Test Image");
    
         form.append (testImage);
      }
      catch (IOException e) {
        form.append (new StringItem
          ("Error:", "" + e));
      }
    

    Can anybody cast an eye over this and suggest what might be going wrong? I've been at this for hours now :confused:


Advertisement