NetBeans Forums
| View previous topic :: View next topic |
| Author |
Message |
ericScorp
Joined: 11 Sep 2010 Posts: 1 Location: JB, Malaysia
|
Posted: Thu Sep 23, 2010 3:03 am Post subject: please help me to create image |
|
|
i use netbean IDE 6.9.
i wan to use my png(picture) in my coding, i get null exception.
this my sample coding:
package ImageRead;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.Image;
public class Midlet extends MIDlet {
private Image imgBox;
public void startApp() {
try{
imgBox=Image.createImage("/box1.png");
}catch(Exception e){
System.out.println(e.getMessage());
}
int nPanelWidth=imgBox.getWidth();
}
}
i put my picture in my package folder (ImageRead), same folder as my Midlet.java file. can anyone please help me? the coding is just a part from my project. thank you. |
|
| Back to top |
|
 |
DeviantKarot
Joined: 02 Nov 2010 Posts: 1
|
Posted: Tue Nov 02, 2010 6:17 pm Post subject: |
|
|
In the Projects window, you have a Resources entry :
right click -> add folder,
and select the folder containing your picture. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|