Reputation: 65
I have a problem related to spacing in labels. there are four labels which are placed in a panel , 1st contain image while other contain plane text. I used Grid Layout because I want them in line by line but wanting no space between labels. How I can do ...........? help me. This is code.!
and I have the following result.!
Upvotes: 0
Views: 182
Reputation: 7324
All cells in GridLayout have equal size. You have to use GridBagLayout or SpringLayout or BoxLayout .
Upvotes: 0
Reputation: 324147
Don't use a GridLayout because a GridLayout makes all components the same size so you get the spacing that you see.
You might try a vertical BoxLayout
. Check out the section from the Swing tutorial on Using Layout Managers for more information and examples.
Upvotes: 3