Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Missing something: J2ME ImageCreate

Options
  • 11-04-2008 12:29am
    #1
    Registered Users 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