IMO, having many simple layout managers is a poor approach. As soon as you need a little bit more flexibility than they can provide, then you're stuck and have to switch to a more complex layout manager anyway, or write your own which is time consuming and error prone.

I'd like to suggest my own layout manager, TableLayout. It works for Swing, Android, libgdx, and TWL. It only has about 8 constraints, and a couple of those are not used very often. With a minimal learning curve you can easily layout almost anything.

I agree with Riven here. You can get a lot farther than you think with just BorderLayout, BoxLayout, and BorderFactory.createEmptyBorder(). Maybe a couple of other basic LayoutManagers thrown in here and there. Swing newbies tend to get frustrated (rightfully so) because of the steep learning curve, and start mucking with minimum/preferred sizes, which is almost always the wrong approach.

@Nate, TableLayout looks nice, but it looks like it doesn't support RTL locales?

Correct, no RTL stuff. To be fair, BoxLayout, etc also has no RTL support. It probably only makes sense in certain contexts, eg buttons on a dialog should be shown in reverse order. I don't think you generally want a layout manager to change the order of your widgets.

Actually, it's been awhile, but I think most (?) built-in LayoutManagers support RTL in some way (SpringLayout comes to mind as one that doesn't). At least, BorderLayout, BoxLayout, and GridLayout do I know. With table-ish layouts, I'd think it would be as easy as reversing the concept of "left" and "right", perhaps using constants like BoxLayout has with LINE_AXIS.

But if nobody asks you for that feature, why bloat the library with it?

Oh, my fault. I'm not that familiar with RTL, obviously. I guess it is something that happens automatically. Not sure that is a good idea, it seems like some layouts would not want to be reversed even for RTL.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org