I have a little problem with Swing (or maybe netBeans), I was making a testing JFrame
, I changed its background by an image with this line of code:
this.setContentPane(new JLabel(new ImageIcon(ImageIO.read(new File("src/testdesign/BG.png")))));
And I added a JLabel
with an Icon
to the frame using netBeans.
The result when compiling the project (In the IDE) was:
All is fine.. But when I generate a JAR file, the result is:
I'm not a Java pro, so I think that the way I changed the background isn't the proper way, or maybe it's another thing.