Reputation: 2089
I would like some help on choosing or creating a layout for a component to which I will add labels at runtime. For example the component size will be 400*50 and empty when the application start up. Then some action will add a first label at position 0, the second at position first label's width, the third at first label's width + second label's width and so on. A bit like the FlowLayout
except that I want my labels to start at the left of the container and not in the center.
Thanks for helping.
Upvotes: 1
Views: 109
Reputation: 234847
Just use a FlowLayout
and call setAlignment(FlowLayout.LEFT);
(or use one of the constructors that takes an alignment code).
Upvotes: 2