Reputation: 135
I'm using gridbaglayout for layout manager. And its size 6*10. But when i change jlabel text that inside gridbaglayout all columns auto resized. How can i prevent this behavior? I wanna column and row size be fixed.
Upvotes: 0
Views: 5326
Reputation: 94635
You need to set GridBagConstraints.gridwidth
constraint. (Tutorial).
GridBagConstraints gs=new GridBagConstraints();
/* It specify the number of columns in the component's display area */
gs.gridwidth=3;
Upvotes: 1