posted 14 years ago
What is it with GridBagLayout(Consraints), is it me or does this simply not work!?
Can anyone explain the reason why I weould get totally different responses with the folowing longwinded way and my 'neater' way of setting the GBC params?
JButton btn1 = new JButton("A Button");
Long winded way:-
My way:-
Uses this simple Setter method
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?