Creating a new GUI in Java (1.8) Swing, I am searching for a way to override resize behavior of all my components.
Let me explain to you with some edited photos:
The important sequence is this:
frame.revalidate();
frame.pack();
frame.repaint();
Use this sequence after each series of changes, you have done in your code and want to see the results appearing on screen.
I like the java.awt.GridBagLayout in combination with the java.awt.GridBagConstraints and I use this layout on all containers starting up from the content pane.
If you add a container into an other container use a layout on each of them, otherwise the calculation fails because of a missing layout in the hierarchy.