In .NET if I want to create window with two panels on the sides, I can add the TableLayoutPanel on the window, and specify three columns: fixed sized, auto-sized, and fixed-sized again. Both panels will save their size in a case of window resizing.
How can I do this with Swing?
Looks like a simple
BorderLayoutwill do the trick. It allows to specify up to 5 panels (PAGE_START, PAGE_END, LINE_START, CENTER, LINE_END) but you will only need the last 3 ones. All extra available size goes to the CENTER area, meaning the size of your side panels remains constant.Just for reference: the Visual guide to layout managers is always a good starting point if you are looking for a
LayoutManagerwith certain properties