NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

please help me to create image

 
Post new topic   Reply to topic    NetBeans Forums -> Java ME Users
View previous topic :: View next topic  
Author Message
ericScorp



Joined: 11 Sep 2010
Posts: 1
Location: JB, Malaysia

PostPosted: Thu Sep 23, 2010 3:03 am    Post subject: please help me to create image Reply with quote

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

PostPosted: Tue Nov 02, 2010 6:17 pm    Post subject: Reply with quote

In the Projects window, you have a Resources entry :
right click -> add folder,
and select the folder containing your picture.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> Java ME Users All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo