Swing blank frame

This Card method returns the image of a card as an ImageIcon in a JLabel, or just the filename attempted for use of the filename if no image is found. The cards show up great when I launch from the IDE, but when I package it into a JAR file, the filenames point to the right place but nothing shows up in the middle of the JFrame, just a JMenuBar and the frame itself. Have I forgotten to set something visible or am I getting images in a wrong way?

public JLabel getCardImage(boolean selected,boolean highlighted,int width)

{

try

{

//BufferedImage im = null;

URL imURL =null;

if (!selected && !highlighted)

imURL = Card.class.getResource("cards/"+this.fn());

if (selected)

imURL = Card.class.getResource("cards-sel/"+this.fn());

Icon icon =new ImageIcon(imURL);

if (width < 71)

((ImageIcon)icon).setImage(((ImageIcon)icon).getImage().getScaledInstance(width, 70, Image.SCALE_SMOOTH));

returnnew JLabel(icon);

}

catch (Exception e){returnnew JLabel(this.fn());}

}

[1824 byte] By [ryanknua] at [2007-11-27 3:24:23]
# 1
We don't see nothing from your post:Your class package structure.How your Jar is composed.Your manifest file or e option value.What is done in your fn() method.etc.....
hiwaa at 2007-7-12 8:27:09 > top of Java-index,Security,Cryptography...
# 2

First of all I would suggest instead of eating that exception I would print the stacktrace, since I'm sure you probably getting an exception and you don't know it since you just create a label anyway.

Second, you should just catch an generic Exception this is not good practice, since you will catch exceptions(NPers) that are really bugs in your applications.

born2snipea at 2007-7-12 8:27:09 > top of Java-index,Security,Cryptography...