anonymous
2010-07-21 11:11:07 UTC
if (//certain file exists)
{
Icon icon = new ImageIcon("/images/B.png");
JLabel.setIcon(icon); //Here, JLabel is my JLabel where A.png is currently set as the default image.
}
When the if statement is true, the image A.png disappears and nothing shows up. Both images are the same size (in terms of dimensions). My guess is I have the wrong path for the image. I have tried...
/image/B.png
image/B.png
/B.png
B.png
Any help would be appreciated. Thank you in advanced!