Ever had the experience of being frustrated in NetBeans when you resize your window container but instead resizes itself back to a bigger size? When using a Free Layout to place your components in the container, sometimes we resize the container so we can position the components according to where we want to place them.
But what if after positioning all your components, you resize your window form so that it will be the right width and height and it suddenly resizes itself back to a bigger width and height. This was an annoying experience for me. The solution to fix this is to place all your components in a JPanel. Chances are, you added components directly to your window form, adding it to the ContentPane. Just use a JPanel or any other container and you will be fine.