Win a copy of Getting started with Java programming language this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Inserting Image in J2ME  RSS feed

 
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...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!