Hello again DW. Tomorrow I have an interview and I'm trying to make a jar of my latest project. Using netbeans, I've created a jar and everything looks fine. I can see all the card IconImages in the Jlabels and it looks fine. But when I repaint the frame, the card images arent repainted. Its like the path is incorrect or something. But when I run the project, the repainting runs fine. Its only in the jar that I'm having this issue. I appreciate any help.

Here is some code:

//---------This code re sets the ImageIcon of the JLabels.
  if (comp.equals("pHand1"))
              try {
          pat = getCardImagePath(card);
          catch(Exception e)
                System.out.println("Error999: "+e);
            pHand1.setIcon(new ImageIcon(pat));
//............This code is part of getCardImagePath method and gets the path based on param.  It returns the path string representing the image path.

char sut = card.getSuite();
        int nub = card.getNumb();

        if (sut == 'S')
            if (nub == 14)
                path = "src/poker/resources/spades-a-75.png";
            else if (nub == 2)
                path = "src/poker/resources/spades-2-75.png";
            else if (nub == 3)
                path = "src/poker/resources/spades-3-75.png";
            else if (nub == 4)
8 Years
Discussion Span
Last Post by ryno365

scratch that, I figured it out. I just changed the image paths from "src/poker/resources/spades-a-75.png" to "../src/poker/resources/spades-a-75.png"


Dangit. I still need help with this. For some reason the image paths work fine if the jar stays in its dist folder. But if moved to another folder (such as desktop) or to another computer, the images still dont show up (I'm guessing due to the file paths).

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.