I'm having some problems with my Java interface, where I'm trying to put a background image on my JFrame
.
I searched on the internet and I found a 3 lines of code that work (it prints the image), but the problem is that the image stays above all the rest and wides the text, at least that's what I think is happening!
Here is the code I'm using to print the image:
setLayout(new BorderLayout());
setContentPane(new JLabel(new ImageIcon("lock.jpg")));
setLayout(new FlowLayout());
Can someone explain what or why this is happening and give any solution?