Hi, I've got the following structure: The workspace is bin (folder)and inside this folder I've got the editor (folder) package and images(folder where there are all the images for the buttons). Inside the editor package is the JTEdi.class, which is the class that has the main method and as well some other packages and more classes inside those packages. to create the jar file from the command line, I stand in the bin folder and type: jar cmf manifest.mf jtedi.jar editor images (insede the bin folder there is a text file manifest.mf which has two lines . the first one is Main-Class: editor.JTEdi, the second one is an empty line) after that it created a jtedi.jar inside the bin folder and to run it I typed: java -jar jtedi.jar All that work just perfect, but if I put the jtedi.jar file in another folder and type from the command line the same java -jar jtedi.jar it works but it doesn't display the images on the buttons, intead (I'm using actions) it displays the description of the action. what could be the problem? Thanks,
i propose two check Two things 1) Is your images inside your jar ? 2) Are you sure your images respect uppercase and lower case ?If you are working on windows the file system do not care about Casing in the file name but inside the jar it is important! that's idee i have! [ July 09, 2003: Message edited by: Benjamin Leonard ]
Hi, I checked the link about the jar file that you gave me. I followed all the steps but now all the all time I get a null value. I tryed as well
but it doesn't work neather. the las method is used to create the image in one of the constructors, but I got another class that extends ActionCommand and is actually the class that get the images, I wonder if I get the images in the class that contains the main method?
You told the jar this: (inside the bin folder there is a text file manifest.mf which has two lines . the first one is Main-Class: editor.JTEdi, the second one is an empty line) so the JTEdi.java has to have the main method.
Hi, Thanks for answer me back, but that is not the problem, if you read my first post on this topic, you will see the problem and as well the answer from nathan pruett. I read the the web he mentioned and the method getResource() always give back a null value I cannot make work. thanks,
How are you loading the images in your app? Are you also putting the images in the JAR file like in the link? Or are you loading them from the file system? If you are going to use a JAR file you should include the images in the JAR.
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop