NetBeans Forums
| View previous topic :: View next topic |
| Author |
Message |
rzs
Joined: 14 Jul 2010 Posts: 1
|
Posted: Wed Jul 14, 2010 4:07 pm Post subject: Adding image to a midlet form in Netbeans 6.8 |
|
|
Hello,
Im using Netbeans 6.8. I want to add a jpg file to a form. The code i wrote for that is shown below. Is that correct ?. Also, where to place the image in my project folder ?
I created a folder called images in my main project directory, and added the image to it.
Then I added the folder to resources by going to my Project Properties->Libraries and Resources and then adding the images folder.
But,when i run the program in the emulator, i get java.io.IOException.
Am i adding the image the right way ?
| Code: |
try{
image = Image.createImage("/images/pic.jpg");
}
catch(Exception e){
System.out.println("Error:"+e);
errorMessage.setLabel("Error:");
errorMessage.setText(e.toString());
}
|
Please help.
Thank You |
|
| 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
|
|