Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

GridaBagLayout and Container

 
Alex Kravets
Ranch Hand
Posts: 476
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
In my applet, I use GridBagLayout. When applet loads, the components in the applet are not positioned all the way at the edges of the container. Another words there is a margin off the top and left sides. I do position all of my components at (0,0). So what causes margin to appear?
thanks,
Alex
 
Chantal Ackermann
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
try specifying the anchor: c.anchor = GridBagConstraints.NORTHWEST;
and specify the filling: c.fill = GridBagConstraints.HORIZONTAL;
chantal
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic