Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

is possible to add Image or Image item ?

 
Edward Durai
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

is possible to add Image or Image item in List? in midp. i write sample code.but the image not shown. i put image in res folder. IS IT CORRECT?

try {
Image image = Image.createImage("/Icon.png");
imageItem = new ImageItem("", image, ImageItem.LAYOUT_CENTER, "Alternate text for the image file");


form.append(imageItem);
}

I develop using wtk22. and convereted to prc. Then prc to palm.

But i can't able see the image?

Pls send your reply
is possible to see image in palm
 
Aryan Khan
Ranch Hand
Posts: 290
Java Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No that is not possible...
ImageItem can only be added to Form, I wonder how u could compile it...
 
Aryan Khan
Ranch Hand
Posts: 290
Java Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But u can show an image with each item in a list
 
Michael Yuan
author
Ranch Hand
Posts: 1427
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you see the image when you run the MIDlet in wtk? If so, you might need to pack the JAR file and convert to RPC by hand to make sure that the image is included.
 
Edward Durai
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Thanks for ur Kind reply,

I added Image and ImageList in List. It's perfectly executed. I Converted to PRC files(image also included in jar file.Yes i am sure Mr.Michael Yaun) and i applied PALM but image not displayed. BUT PALM DEFAULT ARROW (--> only displayed. Kindly tell your suggesting as soon as possible.
 
Denise Laing
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Edward,

Thank you for pointing me to the JavaRanch website. I wasn't able to resolve my own problem with the images, however I'll let you in on what I have discovered. I found that my .png images (which I had created using Microsoft Paint) would not display, but as an experement I tried using one of the .png images which were included in the J2ME Wireless Toolkit demos and successfully displayed it on the Palm simulator. My best guess is MIDP can't resolve these images and I'll need to figure out another way to create a .png image. Hope this helps,

Denise
 
Denise Laing
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Edward,

I just discovered that in my case it was actually because the filename including the extension is case sensitive! The file name was "helloworld.PNG", but I had typed it as "helloworld.png". I can't believe that had me stumped for so long I guess the wireless toolkit still loaded them but MIDP wouldn't.

Denise
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic