0

I am using a Jpanel an adding JLabels that contains Icons to it. I am using GroupLayout. My problem is that when I try to add the seventh component the Jpanel changes its size by itself although there is still enough space for it to add other components.

The normal working of the Jpanel :

enter image description here

when I add more elments the JPanel changes the size although there is enough space for new element to be added

enter image description here

Any help will be highly appreciated

mKorbel
  • 109,525
  • 20
  • 134
  • 319
Mes M
  • 17
  • 2
  • Did you set the minimum size, the maximum size, the preferred size and the size of your JPanel object? – Lajos Arpad Sep 18 '13 at 23:50
  • 1
    `GroupLayout` is a fickle mistress. Have you tried another layout manager? – MadProgrammer Sep 19 '13 at 00:07
  • No I didn't. I was hopping that I will find a solution, but if nothing else seems to work I guess I will have to change the layout – Mes M Sep 19 '13 at 00:14
  • Problem solved by using a left aligned FlowLayout in the Jpanel. Thank you all for your suggestions. – Mes M Sep 19 '13 at 14:55

0 Answers0