Outsider710
Outsider710

Reputation: 19

Which LayoutManager to choose for a Swing app?

Which layout manager (if many, which layout manager to which type of window) in Swing is the best or usually preferred by programmers?

I need to write, a GUI app for university exercise and I don't know which layout I should choose. In exercise I have many windows start form simple alert window to windows with multiple components.

I already tried MigLayout.

Upvotes: 0

Views: 54

Answers (1)

Mark Bramnik
Mark Bramnik

Reputation: 42471

There are many layout managers available in Swing.

However you should notice that layout manages usually manage a component (panel) and not a whole application.

So you can mix between them. Think about it as an hierarchy. Utilize JPanel and assign a layout to it. Then think that there can be a panel inside the panel that has some particular layout, and for that internal panel you might want to apply an another layout manager.

Now they all are aimed to help to put components with certain order. The question is how do you see the application visually.

MigLayout in particular is very flexible and powerful, but yet requires some configurations.

So after all its the question of your ideas and creativity, its your choice.

Upvotes: 1

Related Questions