jerome
jerome

Reputation: 2089

Layout labels from left to right

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

Answers (2)

Reimeus
Reimeus

Reputation: 159844

You can use FlowLayout(FlowLayout.LEFT)

Upvotes: 2

Ted Hopp
Ted Hopp

Reputation: 234847

Just use a FlowLayout and call setAlignment(FlowLayout.LEFT); (or use one of the constructors that takes an alignment code).

Upvotes: 2

Related Questions