Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

path for Image.createImage() in MIDlet

Status
Not open for further replies.

edzillion

Programmer
Feb 20, 2004
8
IE
I am trying to use JBuilder for a wireless project I am doing, and finding it very difficult to figure out where to place my images and access them.
I was going through the midp 2.0 on microjava.com

I am tring to load an image into my Cowboy sprite:

Code:

public class Cowboy extends Sprite {

...

super(Image.createImage("/icons/tumbleweed.png");



I found the package setup confusing so I removed that and here is my dir structure:

--JumpProject
¦--bin
¦--classes
¦ ¦--icons
¦
¦--src
¦--tempclasses

Set up like this it works fine. But since the icons folder is in the classes folder it gets deleted everytime i 'rebuild'. So I tried moving the icons folder into the root and accessing it from createImage("../icons/cowboy.png") - didnt work.
I tried various combinations of moving the files around and changing the path and had no luck.
Is there something I am missing?
It works fine in WTK22.

regards,
ed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top