ofc i want to not resize my buttons or labels. let them stay their default sizes.
Then you should set the weightx = 0, weighty = 0
so that their respective row and col will not get extra space, which you are currently setting to 1
. Also GridBagLayout
generally respects preferred size, but we should specify both preferred size and minimum size as is explained in a use case of this question. Also take a look to specifying constraint section of official sources for more details.