I have a JFrame with BorderLayout, there are panels on all sides (North, East ,…). In the panels there are labels and buttons mostly.
Now I want the frame to have a background image, some research told me that i had to change the content pane of my frame.
When I try this however, the content gets put in the background and isn’t visible. Also, I don’t know how to resize the image if the frame is resized.
Is there an easy fix for this or will I have to rework most of my code?
put
JPanel(orJComponent) with background Image to theBorderLayout.CENTER, then thisJPanelfills wholeJFramearea, rest of youtJComponentsput to thisJPanelthere are Jpanels on all sides (North, East ,...). In the Jpanels there are Jlabels and Jbuttons mostly.these
JComponentscovered all availableRectangleforJFrame, thenBackground Image(from my 1st point) never will be dispalyed, because theseJComponentsare on_topJFrameand could be hide thisImageas well,add
JPanel with Background Image(from my 1st point), then put there anotherJPanel(s)withJPanel#setOpaque(false);, then thisJPanelwill be transparent, noticeJPanelhas implemented by defaultFlowLayout