If you run it you'll see how the labels don't match up with the text areas... I'm very bad at position components using swing, so I was wondering if anyone could help me find a way to line them up. I have all my JLabels in one panel and my JTextFields in another because that was the easiest way to get them side by side like that.
Read the Swing tutorial on Usint Layout Managers. You could use two panels each with a GridLayout. Or you could use a single panel with a SpringLayout. In both case you will need to use a dummy component for your text field that doesn't have a related label. Box.createVerticalStrut() can be used for this.
You can either get your UI straight with the Gridbag layout (it takes some time to get used to it) or check out Mig Layout
Joined: Jun 16, 2009
Maneesh Godbole wrote:Layout managers were created for a reason. Using null layout and specifying the absolute location of components will land you into all kinds of trouble and give you immense grief in the end.
Yes Maneesh, I'm totally agree with you, set layout into null is suicide.. I just wanna show how to play with component coordinates... Thanks for "the light"...