I have a few other components on the Panel all of which I have tried using the long winded way and my way, the long winded way gives me the layout I'd expect, my way and the components end up all over the place.
Surely the setGridBagConstraints() should simply be creating a new instance of GridBagConstraints and setting it's params?
posted 5 years ago
Assuming the constraints are the same the result will be the same.
Just remember that using the "long winded" way any constraint you don't specifically reset is carried over from the last component. In your "neater" way you reset every constraint.