-
November 27th, 2008, 01:35 AM
#1
How to include images in a JAR
Hi,
I have a java application(stand alone) coded as net beans application.
When i build the file i got a JAR file in the dist folder. I can get the imges only if i placed the images in the dist folder. Is there any possible to embed all the images within the JAR file itself so that the application can be executed using a single JAR file.
Hoping your valuable comments
thanks and regards
Arun
-
November 27th, 2008, 05:58 AM
#2
Re: How to include images in a JAR
Google is your friend: Loading Images.
One can think effectively only when one is willing to endure suspense and to undergo the trouble of searching...
J. Dewey
Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.
-
November 28th, 2008, 01:58 AM
#3
Re: How to include images in a JAR
yeah - make new directory such as image, or include them in JAR by setting up what types of files are included in JAR itself, there's setting in netbeans project options for that
-
July 23rd, 2009, 02:11 AM
#4
Re: How to include images in a JAR
Originally Posted by 2arunvr
Hi,
I have a java application(stand alone) coded as net beans application.
When i build the file i got a JAR file in the dist folder. I can get the imges only if i placed the images in the dist folder. Is there any possible to embed all the images within the JAR file itself so that the application can be executed using a single JAR file.
Hoping your valuable comments
thanks and regards
Arun
Create an images folder named images on the src folder and placed the images/icons onto there. After compiling you will get those images in the class folder .
You can access by the followings-
URL url = XLGamingCommonConstants.class.getResource("images/application-icon.gif");
Image image =Toolkit.getDefaultToolkit().getImage(url);
Thanks
Baruri
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|