Originally posted by Maneesh Godbole:
Check out this tutorial
Maneesh, did you really send him
that with no further explanation??
There is a class called GBC which Cai Horstmann developed (look
here and search for GridBag on the page). That allows you to set all your constraints in a single statement. If you grasp the concept of GBC, it is easy enough to write your own version. Just don't do what I did once, passing
null as the insets value.
The
GridBagLayout API page has a list of what the constraints are.
Some Components (eg JTextField) shrink down almost to nothing unless you instruct them not to. Try:
setting a preferred size on the Componentsetting a HORIZONTAL or BOTH value for the fill. Apart from that, start small and practise with larger applications.