I am stuck in a small sample program using gridbaglayouts. In one of
my current program assignments i created some GUI forms with a basic
panel then a couple of subpanels for the fields. The Top level panel i
made Borderlayout then inserted the other two panels in the north and
center area. Then within those panels i used gridbag layouts. It
worked fine, but one of the things i noticed and don't like is that
some of the text fields appear to be way off to the side in relation to
the labels identifying the text field. So, i started reading up more
on gridbaglayouts and found the borland site where they suggest using
gridbaglayouts for all the panels as opposed to what i was doing. I
decided to give it a try with a small test program. What i find now is
that the top level panel appears fine but the other panels show up in
the center. I know this may be vague, but i am just wondering why a
panel would be placed in the center of another panel when i give it the
x,y coordinates of 0,0. I would have thought that it would line up on
the top left corner of the toplevel panel.
John McGrath - 28 Mar 2005 02:57 GMT
> I know this may be vague
Indeed. Consider posting code.
> i am just wondering why a panel would be placed in the center of another
> panel when i give it the x,y coordinates of 0,0. I would have thought
> that it would line up on the top left corner of the toplevel panel.
Try searching the GridBagLayout JavaDocs for the word "center".

Signature
Regards,
John McGrath