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());}
}

