Java Vertical Layout?

Jimmt picture Jimmt · Jan 21, 2012 · Viewed 40.2k times · Source

I need to position a JLabel over some JButtons, vertically, like a game menu. They should all be centered. I already downloaded MigLayout, but I'm not sure how to use that, so I just want a way to position my components vertically and centered, MigLayout or not. Also, I don't want to use a IDE GUI designer.

Answer

Andrew Thompson picture Andrew Thompson · Jan 21, 2012

You might use a (single column) GridLayout or BoxLayout for this. See Using Layout Managers & A Visual Guide to Layout Managers for more tips, ideas and working source.