Diamond
Diamond

Reputation: 7483

How to prevent west and East elements from overlapping center in BorderLayout

I'm trying to create a layout in this sketch

sketch

I want to have a vertical slider in the center, one SpanLabel on the left and another on the right.

I've tried using BorderLayout, but the SpanLabels overlap the slider if their texts are long. Is there a Layout that I could use to achieve a similar style or something I could do to fix BorderLayout?

CenterAbsolute and CenterCenter don't help in fixing this.

Upvotes: 1

Views: 299

Answers (1)

Shai Almog
Shai Almog

Reputation: 52760

I'd use a TableLayout with percentages for each column to achieve this sort of layout.

BorderLayout assumes the preferred size of the elements on the sides/top/bottom isn't too big to cover everything so it's a bit problematic in some use cases.

Upvotes: 1

Related Questions