• Post Reply Bookmark Topic Watch Topic
  • New Topic

why JSeperator is shown with extra space on JPanel ?

 
Alok Kmishra
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
there is a main JPanel in my application in that main JPanel i want to add two JPanels with a seperator in between . Though i have added the seperator but its taking some extra space and when i am changing its size , there is no effect . how can i remove/reduce this extra space taken by JSeperator? below is view logic ,
wer.JPG
[Thumbnail for wer.JPG]
the extra space is between vertical JSeperator Line and JPanel with white background
 
Rob Camick
Ranch Hand
Posts: 2699
10
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are using a GridLayout. The GridLayout makes every component the same size in the grid, so you can't remove the extra space.

Use a different combination of layout managers to achieve your goal. Maybe a GridBagLayout for your 3 columns.

Read the section from the Swing tutorial on Layout Managers for more information and examples.
 
Campbell Ritchie
Marshal
Posts: 52549
119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...and welcome to the Ranch
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!