| Reply | « Previous Thread | Next Thread » |
|
hi...in my app, i am trying to read some pre-stored images from jar file..I am using netbeans..my questions are:-
1) i created a folder called "res" and stored all my images in it. Then in my code :- Code:
InputStream is4 = getClass().getResourceAsStream("/res/basic.jpeg");
Code:
Image.createImage("/res/basic.jpeg")
Where exactly can I put my pre-defined imagefiles in jar and in wat location..What are the settings required in netbeans for this apart from adding res folder? PS:- I also tried using "/basic.jpeg", "basic.jpeg", "res/basic.jpeg" Please help on this |
|
Have you checked the JAR file that the images really exist in there (inside the res directory)? You could for example open the JAR file using WinZIP (JAR file is basically a Zip file)...
Hartti |
|
Hi hartti,
thanks for the help, but when i untared the jar, I was not able to see any images in it. How do I mention jar file to store images through netbeans. I have created res folder, added that as resources in netbeans through project property, but it just doesnt work.... |
|
I just quickly tested this. I was able to add resources to the jar file through Project Properties
In short... In there, go to Build -> Libraries & Resources click Add Folder... button and select the folder containing the resources Hartti |
|
hi hartti,
thanks very much for ur help. Well, what I did was that I stored all "jpg" files and was referiing to them as "jpeg" files in my code. Hence it gave me null pointer exception.:)) All I did was as pointed by you, Project->Properties->library and resourcse->Add folder. Here I added res folder wherein I stored my "jpg" files...now i am able to see them...:) thnx once again.. |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Image - byte[] - String (re)conversion | lampz | Mobile Java Media (Graphics & Sounds) | 1 | 2008-02-19 12:47 |
| Opening a JPEG Image | ummarbhutta | Mobile Java Media (Graphics & Sounds) | 8 | 2007-02-15 07:34 |
| Resize Image while read byte | manupeco | Mobile Java Media (Graphics & Sounds) | 1 | 2007-01-29 17:22 |
| how to cut some part of Image | mshouab | Mobile Java Media (Graphics & Sounds) | 2 | 2006-08-04 10:05 |
| Image Uploader / Image Downloader / Image Server | kehong | General Symbian C++ | 0 | 2003-05-12 18:38 |