Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / October 2005

Tip: Looking for answers? Try searching our database.

newbie: j2me, adding resources to midlet

Thread view: 
Jeff - 10 Oct 2005 19:57 GMT
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
David N. Welton - 11 Oct 2005 11:35 GMT
> Hey
>
[quoted text clipped - 7 lines]
> 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,
Signature

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

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

Darryl L. Pierce - 12 Oct 2005 11:30 GMT
> 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.

Signature

Darryl L. Pierce <mcpierce@gmail.com>
Homepage: http://mcpierce.multiply.com/
"Bury me next to my wife. Nothing too fancy..." - Ulysses S. Grant

Darryl L. Pierce - 11 Oct 2005 12:45 GMT
> Hey
>
[quoted text clipped - 7 lines]
> 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".

Signature

Darryl L. Pierce <mcpierce@gmail.com>
Homepage: http://mcpierce.multiply.com/
"Bury me next to my wife. Nothing too fancy..." - Ulysses S. Grant



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.