Forum Controls
Spotlight Features

The Rich Engineering Heritage Behind Dependency Injection

Andrew McVeigh takes us on a tour of the rich heritage behind dependency injection, what it represents, and tells us why its here to stay.

NetBeans 6: Matisse Updates

NetBeans 6 delivers great updates to the Matisse GUI builder. Spend a few minutes with Roman Strobl and get an expert briefing on what's new and what has changed.

Introduction to Groovy Part 3

In this, the third and final installation of Andres' Introduction to Groovy series, you learn about how Groovy handles variable numbers of arguments, named parameters, currying, and more about Groovy operators. Including, some new operators.

Easier Custom Components with Swing Fuse

Swing Fuse (actually just Fuse), is a framework designed to make it easier to create your own custom desktop components. In this article, Daniel Spiewak shows you how to get started and provides sample source code you can download.

Benchmark Analysis: Guice vs Spring

Willam Louth shows how he uses JXInsight Probes to investigate probable performance issues with code bases that he is not familiar with. He also highlights possible pitfalls in creating a benchmark, as well as in the analysis of results.
Replies: 55 - Pages: 4   [ 1 2 3 4 | Next ]
Threads: [ Previous | Next ]
  Click to reply to this thread Reply

The One Layout Manager to Rule Them All!? (Updated)

At 2:29 PM on Sep 12, 2006, Matthew Schmidt wrote:

MigLayout is a the most versatile SWT/Swing layout manager written, yet incredibly simple to use. It is use-case optimized for manually coded layouts and is using string constraints to format the layout. And for many the most important thing: It's free to use and will be Open Source.

Read this exclusive introduction to MigLayout now!


UPDATE! (by Mikael Grev)

After many emails I have decided to add API support to MigLayout. This way it will be more Java-like and it'll get easier to find the docs, since the API calls are JavaDoced the normal way.

Something like:
panel.add(comp, CC.gridPos(1, 2).width(100).pad(1,2,3,4));
 
or
 
new MigLayout("", GC.gap(1,"10px").gap(10,20,"5px").size(1,20,"30px"), ...);


This also means that you can set the gap for row X using an index and things like that. Or set ranges of gaps to a certain value.

It also means that it will be even simpler to add MigLayout support to IDEs.

It will add some 10-20k to the .jar though..

/Mikael
1 . At 11:18 PM on Sep 13, 2006, Kirill Grouchnikov wrote:
  Click to reply to this thread Reply

Re: The One Layout Manager to Rule Them All!?

One question is whether we should push for MigLayout to be included in JDK 7 - well, perhaps you should wait with this question until after people have a chance to download it, try it and compare it with other layouts? Let's not jump ahead of ourselves here, since JGoodies is a very strong opponent (with no outside confirmation yet as to the superiority of MigLayout), and Sun has its own layout that Matisse uses "natively". If you're really pushing to include this in JDK 7 (i don't see any reason yet to do this, by the way), you may want to think about renaming the main class name. In addition - do you really want to get stuck with 2-year release cycle?
2 . At 12:26 AM on Sep 14, 2006, Mikael Grev DeveloperZone Top 100 wrote:
  Click to reply to this thread Reply

Re: The One Layout Manager to Rule Them All!?

It's just a thought, and an offer. If included it would be renamed of course.

Chances are slim it will be.

Cheers,
Mikael Grev (grev at miginfocom dot com)
MiG Java Calendar Component, MiG Layout for Swing/SWT (Vote -> JDK)
3 . At 3:05 AM on Sep 14, 2006, Kirill Grouchnikov wrote:
  Click to reply to this thread Reply

Re: The One Layout Manager to Rule Them All!?

Mikael,

I'm currently revisiting the test application for Substance, and since it has quite a few control panels, i was thinking about using JGoodies layout. Now that you have announced yours, perhaps i should try it instead... The only thing that interests me is the license. Substance itself is under BSD, while the test application(s) are gathered from various contributions and other projects (such as NetBeans color chooser combobox). Since these are not part of official library, I never bothered with the licensing issues for it.

Now, let's say you choose license X (which is more restrictive than BSD). Could i still use it for the test application which is not a part of BSD-licensed library?
4 . At 4:08 AM on Sep 14, 2006, Mikael Grev DeveloperZone Top 100 wrote:
  Click to reply to this thread Reply

Re: The One Layout Manager to Rule Them All!?

Kirill,

You may use it for your test application without restrictions. The license will probably even be BSD unless there is some important reason not to.

Cheers,
Mikael Grev (grev at miginfocom dot com)
MiG Java Calendar Component, MiG Layout for Swing/SWT (Vote -> JDK)
5 . At 9:22 AM on Sep 14, 2006, Will Boluyt wrote:
  Click to reply to this thread Reply

Re: The One Layout Manager to Rule Them All!?

>>MigLayout is a the most versatile SWT/Swing layout >>manager written, yet incredibly simple to use.

I don't agree, check out ZoneLayout! http://www.zonelayout.com
Will
CodeRight
http://www.coderight.nl
6 . At 12:17 PM on Sep 14, 2006, Mikael Grev DeveloperZone Top 100 wrote:
  Click to reply to this thread Reply

Re: The One Layout Manager to Rule Them All!?

I hadn't heard about ZoneLayout before you mentioned it so I was afraid I had built something that was already avaliable. However, I don't see how you can say that ZoneLayout is even remotely as versatile as MigLayout? Everything that ZL has (except for the rather funcy (but interesting) short-scripting) is in the standard arsenal of MigLayout, FormLayout and even GridBagLayout.

There are oodles of things that MigLayout can do, that ZL can't. Expressions, platform gaps, auto-border, different units, screen coordinates, size groups, component links etc.. Check out the White Paper, it lists them all.

Cheers,
Mikael Grev (grev at miginfocom dot com)
MiG Java Calendar Component, MiG Layout for Swing/SWT (Vote -> JDK)
7 . At 12:18 PM on Sep 14, 2006, Mikael Grev DeveloperZone Top 100 wrote:
  Click to reply to this thread Reply

Site's Up!

Also, check out the site miglayout.com where all resources can be downloaded and updates will be posted.

Cheers,

Mikael Grev (grev at miginfocom dot com)
MiG Java Calendar Component, MiG Layout for Swing/SWT (Vote -> JDK)
8 . At 4:09 PM on Sep 14, 2006, Brian Nahas wrote:
  Click to reply to this thread Reply

Re: The One Layout Manager to Rule Them All!?

This looks like a very technically proficient layout manager. Nice work.

However, in my opinion, it still suffers from the same problem as all the other available layout managers in that it's just not intuitive to use and it's very difficult to read the code after doing the initial layout.

So while ZoneLayout may not have as many options at this time, in the majority of cases, I still think ZoneLayout is the better way to go.

But I'm biased. So try it out for yourselves: http://www.zonelayout.com/download.php
9 . At 4:39 PM on Sep 14, 2006, Mikael Grev DeveloperZone Top 100 wrote:
  Click to reply to this thread Reply

Re: The One Layout Manager to Rule Them All!?

Well if one prefer "+-_*!^~" characters to mark layout instead of english words like "fill" and "span" you are correct. However, I think it is clearer to use english.

Btw, IMO it is bad form to promote one's thing in another ones promotion. I'm sure that if you wrote an article about your layout manager Rick would post that to.

Cheers,
Mikael Grev (grev at miginfocom dot com)
MiG Java Calendar Component, MiG Layout for Swing/SWT (Vote -> JDK)
10 . At 4:39 PM on Sep 14, 2006, Will Boluyt wrote:
  Click to reply to this thread Reply

Re: The One Layout Manager to Rule Them All!?

Mikael I respect your work don't get me wrong, I just responded to the title of this thread. ZoneLayout rules (them all) for me and your layout manager is not going to change that because I favor ZL templates over any layout manager that uses string constraints to format layout. Look on the ZL site how ZL compares to other layout managers. The code is much cleaner/readable.

It's not about features it's about what I want to achieve and with ZL I can do that fast and easy.

ZL templates may look funcy at first but once you have done some layouts it's quite intuitive.

SpringLayout can do what MigLayout and ZoneLayout (and probably all others) can do. Problem is you end up with a lot of code and constraints == a total mess :(
Will
CodeRight
http://www.coderight.nl
11 . At 4:44 PM on Sep 14, 2006, Will Boluyt wrote:
  Click to reply to this thread Reply

Re: The One Layout Manager to Rule Them All!?

>>Btw, IMO it is bad form to promote one's thing in >>another ones promotion

You should have picked another title then or did better research on other layout managers before making such a "statement"...

Mikael I am not promoting ZL (sorry if it looks like that) I just give my feedback...
Will
CodeRight
http://www.coderight.nl
12 . At 6:46 PM on Sep 14, 2006, Kirill Grouchnikov wrote:
  Click to reply to this thread Reply

The obsession with strings

By the way - i have a question that is not specific to MigLayout. This is also relevant for FormLayout and ZoneLayout. Why do you use the string / character mumbo-jumbo and come up with all the cheat sheets?

I mean, if i decide to go with MigLayout, i'm not going to switch it in the middle to BorderLayout. So, instead of doing Component.add i'm perfectly OK with doing

MigLayout layout = new MigLayout(component);
layout.add(MigLayout.WRAP);
layout.add(MigLayout.RIGHT).add(MigLayout.Fill, MigLayout.Sizegroup).add(MigLayout.Unrel).add(MigLayout.RIGHT).add(MigLayout.Fill, MigLayout.Sizegroup);

layout.add(new JLabel("Company"), MigLayout.Gap, MigLayout.Indent); // Will add the label to the component passed in the constructor
...

Of course it's more verbose, but much more compile-time friendly. Especially if you're targetting JDK 5.0+, you can take advantage of the varargs feature. Then, just provide a good Javadoc coverage and be done with the cheat sheets
13 . At 6:57 PM on Sep 14, 2006, David Browne wrote:
  Click to reply to this thread Reply

Re: The One Layout Manager to Rule Them All!?

For constraint expressions such as "(button1.x + 1cm - parent.w*0.2))", are you using reflection, or are "button1" and "parent" names created using your "id" constraint? I hope the latter, or I can't use in obfuscated code.
14 . At 7:17 PM on Sep 14, 2006, Romain Guy DeveloperZone Top 100 wrote:
  Click to reply to this thread Reply

Re: The One Layout Manager to Rule Them All!?

Here at JavaZone 2006, Karsten Lentzsch, who wrote FormLayout, said very nice things about MiGLayout. I can't wait to try it :)
Romain Guy
Romain Guy's Java Weblog, #ProgX, Jext

thread.rss_message