By mgrev
via jnb.ociweb.com
Published: May 05 2009 / 18:59
This article introduces the MiGLayout layout manager for Swing applications and shows by example how it addresses different use-cases in comparison with the various JDK built-in layout managers. It also provides a brief discussion about how MiGLayout improves upon the JGoodies FormLayout.
Comments
Jonathan Giles replied ago:
It baffles me as to why mgrev would vote this story up?! :-)
overtheline.myopenid.com replied ago:
This seems a bit naive, as someone who has spent many hours working on cross platform layout managers, Id like to see you demo some buttons that have more than a few letters in the text on MacOSX, you cant get good behavior without serious adjustments to Apples broken Swing. But maybe it works I doubt it. jGoodies is nice for dockable stuff but really doesnt flatter Swing on any platform.
Jonathan Giles replied ago:
So your issues regarding Swing on MacOSX are directed at a very informative and valuable discussion on MiGLayout? Come on - this is a great article and doesn't deserve your misguided negative vote.
guidolx replied ago:
I never used MigLayout but seems wonderfull plus it is being ported to JavaFX! And also works with SWT ? Awesome...
Miloskov replied ago:
This folk overtheline is an idiot! He does not know what his talking about.
jfpoilpret replied ago:
Although I am not a fan of MIGLayout (everybody knows why I believe), I find this ost well written, clear and a good tutorial for new MIG users. I will probably use it as a quickstart guide when I'll write a post comparing MIG with DesignGridLayout;-)
tbee replied ago:
Although DGL is a very good concept, it only applies to generic windows. AFAIK for anything a bit special (e.g. dockingstyle, absolute, spanning) you need a different layout manager. ML can go a long way with keeping it all in one container.
On the other hand; I rarely mix different styles of layout in one container, just to keep the code readable, so that in-one-container may be not that important. But at the least I can do 99.9% of all layouts with one manager. But the right-layout-manager-for-the-job is a defenable approach.
andrewm replied ago:
(btw, spanning is catered for in DGL also)
I like DGL for 2 reasons. firstly, it just seems to give me nice looking results easily according to the rules in the Sano book. secondly, the grid/row concept expands out neatly into a fully OO model. I like this approach, as I can manipulate grids/rows as first class entities.
I really like MigLayout as well, but for different reasons.
Jacek replied ago:
MigLayout is King! All hail the King!
Down with the JDK layout managers. They should all be flagged as @Deprecated
Voters For This Link (42)
Voters Against This Link (2)