Welcome to the Ranch
Why are you using a null layout? The layout managers are all designed to maintain the arrangement of child components when the display is resized, so you would do better to use a specific layout. I know they take time to learn, but it is worth the effort.
What is wrong with this?
You will of course have to ensure there are no other child components being added which occupy the same space.
There are details about layouts in the
Java Tutorials, and there is a helper class for GirdBagLayout
here. If you can find a copy of Horstmann’s book, it tells you a lot more about GridBagLayout; the classic
tutorial (no, classic anti-tutorial
) shows how awkward GridBag can be. It is worth Googling for MigLayout, which I have never tried, but a lot of people say it is better and easier to use than GridBag.
That will give you a layout, only the button on the right will probably appear rather tall and thin.