newbie: j2me, adding resources to midlet

J

Jeff

Hey

midp 2.0
J2ME Wireless Toolkit 2.2
JDK 5

Excuse me if my question is a bit stupid but I'm a newbie...

I'm programming a midlet that needs some image files (.png)... my problem is
that I don't know how to add those image files to the project... I'm using
KToolbar and I cannot see how to add image files via KToolbar....

Have anyone of you some tips for me about this, then please send it to
me....
a link would be great, as I've spent hours searching the net

Best Regards

Jeff
 
D

David N. Welton

Jeff said:
Hey

midp 2.0
J2ME Wireless Toolkit 2.2
JDK 5

Excuse me if my question is a bit stupid but I'm a newbie...

I'm programming a midlet that needs some image files (.png)... my problem is
that I don't know how to add those image files to the project... I'm using
KToolbar and I cannot see how to add image files via KToolbar....

It's actually as easy as adding files to the .jar file. For instance,
here are some ant tasks I use in Hecl (www.hecl.org):

<jar destfile="j2me/Hecl.jar" basedir="j2me/" includes="script.hcl"
update="true"/>
<jar destfile="j2me/Hecl.jar" basedir="j2me/" includes="Hecl.png"
update="true"/>

You could use the 'jar' command directly too if you look up the command
line options to add a file to the archive.

Ciao,
--
David N. Welton
- http://www.dedasys.com/davidw/

Linux, Open Source Consulting
- http://www.dedasys.com/
 
D

Darryl L. Pierce

Jeff said:
Hey

midp 2.0
J2ME Wireless Toolkit 2.2
JDK 5

Excuse me if my question is a bit stupid but I'm a newbie...

I'm programming a midlet that needs some image files (.png)... my problem is
that I don't know how to add those image files to the project... I'm using
KToolbar and I cannot see how to add image files via KToolbar....

Put the files into the res directory under your application's directory,
and reference them with "/res/filename".
 
D

Darryl L. Pierce

David said:
It's actually as easy as adding files to the .jar file.

He asked how to add them to his Wireless Toolkit environment, which
requires them to be placed into the /res/ directory for the project. So,
no, throwing them into a JAR doesn't solve his problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top