• Post Reply Bookmark Topic Watch Topic
  • New Topic

Inserting Image in J2ME

 
Amit Bathla
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Eclipse to develop J2ME application and i am trying to insert image but getting an error java.io.IOException

This is how my code looks like.. I am getting an error in the first line itself.. there must be problem in locating the file... Can i give the absolute path of image.. ??

Image med = Image.createImage("/Elixir.png");
ImageItem Elixir = new ImageItem(null,med,ImageItem.LAYOUT_CENTER,null);
form.append(Elixir);

Can you please suggest where to put image in Eclipse...
 
Amit Bathla
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Eclipse and here is folder structure

MobileClient
.eclipse.tmp
.settings
bin
deployed
res
src

I tried placing in "res" folder but it seems it is not working...
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!