• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Image and ImageItem classes

 
Javier Gomez
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Does anybody know the proper way to display a single .png image using the Image and ImageItem UI classes?
I�m currently using codewarrior for java in order to test my j2me apps and it is unable to load the image which is stored in the root project directory.
I would really thank a sample code or any other resource.
 
Eric Giguere
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You place the image (in PNG format) in your MIDlet suite's JAR file and then you have code like this:
Image img = Image.createImage( "/images/myimage.png" );
This assumes the image is stored as image/myimage.png, of course.

------------------
Eric Giguere
author of:
Java 2 Micro Edition : A Professional Developer's Guide
PalmTM Database Programming: The Complete Developer's Guide
 
john muchow
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can find a description and an example at the following article that I wrote for Onjava.com
http://onjava.com/pub/a/onjava/2001/04/26/midlet.html
You'll also find a link to the source code for all the examples.
john www.corej2me.com
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic