Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Access images in a MIDP application

by BlackBerry Development Advisor ‎02-12-2010 04:34 PM - edited ‎09-16-2010 02:55 PM (2,039 Views)

Summary

 

This article applies BlackBerry® wireless devices based on Java™.

 


Procedure

 

If you want a MIDP application to use images, you can include the images in the application COD file. To do so, right-click the project and select Add file to project. Once added, the image must also be added to the JAD file.

 

Note: The BlackBerry Java Development Environment (JDE) will rebuild an application JAD file each time it is compiled, unless it has been added to the project. In order for JAD file modifications to take effect, the JAD file must be added to the project in the BlackBerry JDE.

 

Below is an example of a JAD file modification for adding an image called midletdemo_jde.png located in an img sub-folder:

 

 

MIDlet-1: MIDlet
Sample,img/midletdemo_jde_bw.gif,
com.rim.samples.device.midletdemo.MidletDemo,
img/midletdemo_jde.png

 

 

The image can be added to a Form using the following line of code:

 

 

myForm.append(Image.createImage("img/midletdemo_jde.png"));

 

Contributors
Users Online
Currently online: 14 members 2,822 guests
Recent signins:
Please welcome our newest community members: