File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes GridaBagLayout and Container Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "GridaBagLayout and Container" Watch "GridaBagLayout and Container" New topic
Author

GridaBagLayout and Container

Alex Kravets
Ranch Hand

Joined: Jan 24, 2001
Posts: 476
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


All right brain, you don't like me and I don't like you, but let's just do this one thing so I can get back to killing you with beer.<br /> <br />- Homer Simpson
Chantal Ackermann
Ranch Hand

Joined: Sep 28, 2000
Posts: 508
hi,
try specifying the anchor: c.anchor = GridBagConstraints.NORTHWEST;
and specify the filling: c.fill = GridBagConstraints.HORIZONTAL;
chantal
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: GridaBagLayout and Container