Image - Problem
From: Yakman (nick_at_yakman.co.uk)
Date: 04/26/04
- Next message: Wonderer: "Re: Problem with Java TCP client to the C server"
- Previous message: Roedy Green: "Re: Classpath and JVM"
- Next in thread: Knute Johnson: "Re: Image - Problem"
- Reply: Knute Johnson: "Re: Image - Problem"
- Reply: Roedy Green: "Re: Image - Problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 26 Apr 2004 15:41:15 +0100
I hava created an applet that uses JLabel and ImageIcon to place an array of
images in the middle of the applet, using the following:
productImages[1] = new ImageIcon(getImage(getDocumentBase(), "pic1.jpg"));
This works fine in the applet.
I then created a seperate class to load the applet using the "public static
void main(String args[])" method, but i could not run the main method unless
i changed the ImageIcon code to:
productImages[1] = new ImageIcon("pic1.jpg");
Again this now works fine.
My problem is that i then created an executable jar file containing the
images an class files.
When i run the jar file my applet runs ok but will not load the images
stored in the jar file. If i place the images in the same folder as the jar
file then they load ok.
How can i get to load the images that are in the jar file.
Many Thanks
--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.657 / Virus Database: 422 - Release Date: 13/04/04
- Next message: Wonderer: "Re: Problem with Java TCP client to the C server"
- Previous message: Roedy Green: "Re: Classpath and JVM"
- Next in thread: Knute Johnson: "Re: Image - Problem"
- Reply: Knute Johnson: "Re: Image - Problem"
- Reply: Roedy Green: "Re: Image - Problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|