Re: Screen Resolution
- From: RedGrittyBrick <RedGrittyBrick@xxxxxxxxxxxxx>
- Date: Fri, 23 Nov 2007 14:58:45 +0000
Abdelali Adil wrote:
RedGrittyBrick wrote:
Abdelali Adil wrote:
I used a GUI builder and i used null LM.
But why?
I use a layout manager for even the simplest prototypes. In a spirit of learning, I'd be really interested in hearing more about circumstances where a layout manager doesn't make development faster (and the prototype more reliable, especially if the screen resolution changes).
Please explain.
Well, this GUI was quite complex therefor Gridbag LM would be the solution, but as maybe you know
Gridbag LM isn't only one of the most powerfull LM but also one of most complex LM and you will need much more time as if you use GUI builder with null Layout.
I agree GridBagLayout is complex (and quirky). That is why I often use
* Nested layouts (e.g. BoxLayout inside BoxLayout)
* MigLayout. More powerful than GridBagLayout, easier, free and concise.
A simple example from http://www.miglayout.com/QuickStart.pdf
+-----+-------------+-----+
|comp1| |comp3|
+-----+ comp2 +-----+
|comp4| |comp5|
+-----+--------+----+-----+
|comp6| comp7 | | |
+-----+--------+----+-----+
panel = new JPanel(new MigLayout());
panel.add(comp1);
panel.add(comp2, "span 2 2");
panel.add(comp3, "wrap");
panel.add(comp4);
panel.add(comp5);
panel.add(comp6);
panel.add(comp7);
I doubt I could do that as easily using a null layout. YMMV
Sizes can be specified in units that take DPI into account (points ,cm, inches etc) It also has "logical pixels" which caters for varying sizes of "normal" font on the platform.
You can specify which components grow to grab available space as the container is resized (weighted, grouped), alignment, insets, equalize button sizes, etc etc etc. It can mimic flowlayout and borderlayout as well as grid oriented layouts.
It can also do absolute positioning, or a mix!
I added MigLayout's source to my workspace, so using and deploying is , for me, the same as for any standard layout manager.
Note: I'm not associated with Mig in any way other than as a happy user of MigLayout.
.
- References:
- Screen Resolution
- From: Abdelali Adil
- Re: Screen Resolution
- From: Andrew Thompson
- Re: Screen Resolution
- From: Abdelali Adil
- Re: Screen Resolution
- From: RedGrittyBrick
- Re: Screen Resolution
- From: Andrew Thompson
- Re: Screen Resolution
- From: Abdelali Adil
- Re: Screen Resolution
- From: Daniel Pitts
- Re: Screen Resolution
- From: Abdelali Adil
- Re: Screen Resolution
- From: RedGrittyBrick
- Re: Screen Resolution
- From: Abdelali Adil
- Screen Resolution
- Prev by Date: Re: Screen Resolution
- Next by Date: Re: Screen Resolution
- Previous by thread: Re: Screen Resolution
- Next by thread: Re: Screen Resolution
- Index(es):