Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ImageIcon not displayed with the JRE

Status
Not open for further replies.

MoreFeo

Technical User
Nov 29, 2002
547
ES
Hi, I've got a program that creates a JTree, and for each node it creates an ImageIcon from gif files. It's been writen with the SDK 1.4.1 and in a computer with the SDK it works fine. The problem is when I try to run it in a computer with only the JRE 1.4.1, the program runs fine, but it doesn't display the ImageIcons. Can anyone help?
Thanks, Manu
 
The images files are refered to with the complete location, like:
conec = new ImageIcon("prog/images/conec.gif");
The prog directory is the root of the packages and directories for this program. I think this should work, cause it works with the SDK.
 
Here's a simple test to try. Create a small program called Class1:

Code:
import java.io.*;

public class Class1 
{
   public Class1()
   {
      File f = new File("test.txt");
      System.out.println(f.getAbsolutePath());
   }

   public static void main(String[] args)
   {
      Class1 class1 = new Class1();
   }
}

Run this program with the JRE. It will tell you what java considers to be the root directory on that platform. If it's not the directory that has the prog/images directory on it, then that's your problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top