I have a window where I added a background image which initially covered all the components of the frame. Then I called GridBagLayout which made the components reappear but the layout of the window changed ie they became messy.
Here is what I did to addthe background image:
Then in the end, I added:
Here is the full code:
Main
I want it to maintain its original layout with the background image. It's okay if the issue with the border at the bottom with its copyright label doesn't get fixed (in case it's too hard to do so) but would really like the logout icon to be in the upper right corner.
Thanks :-)
I believe you need to set the layout BEFORE you add the panels to the frame, otherwise I don't think the constraints are saved by the layout manager, since by default a JLabel (which is now your content pane) uses a null layout until you specifically set the layout.