I've been playing about with GroupLayout manager and what I want to achieve is a several componets stacked on top of each other followed by 2 evenly spaced buttons. I'm not quite sure how to achieve this. If you look at the simple example I have below where I'm trying to have a central label followed by 2 evenly spaced buttons but my label is off centre.
Please ignore any variables I have declared and not used.
As you would see, the label is not evenly spaced above the two buttons. I can follow GroupLayout for more regular layouts but this is more awkward. Could someone point me in the right directions please?
Post by:Maneesh Godbole
GroupLayout is designed for UI builders. You can achieve the effect you desire by nesting layouts.
e.g. Have a container with FlowLayout, center aligned.
Add the label.
Create another container. Add buttons to it.
Add this container to the original container.
Post by:Colm Dickson
, Ranch Hand
Thanks for replying Maneesh.
Yes I can achieve that using a flow layout on a new panel and adding the buttons and it looks fine. I was just trying to do it using the GroupLayout as I had other items on my GUI designed by hand using Group Layout also.
Live a little! The night is young! And we have umbrellas in our drinks! This umbrella has a tiny ad: