java calendar component
Top25 RFE

 

 

MiGLayout - The Java Layout Manager

for Swing, SWT and JavaFX

"MiG Layout makes complex layouts easy and normal layouts one-liners."

 

 

Mig Layout Quick Start PDF

View this PDF for a Fast Start!

 

   
  MiGLayout - Easy to use yet very powerful
 

For Java developers writing GUI layouts by hand that wants simplicity, power and automatic per platform fidelity, that are dissatisfied with the current layout managers in Swing and SWT, MiGLayout solves your layout problems. User interfaces created with MiGLayout is easy to maintain, you will understand how the layout will look like just by looking at the source code.

MiGLayout is a superbly versatile SWT/Swing layout manager that makes layout problems trivial. It is using String or API type-checked constraints to format the layout. MiGLayout can produce flowing, grid based, absolute (with links), grouped and docking layouts. You will never have to switch to another layout manager ever again! MiGLayout is created to be to manually coded layouts what Matisse/GroupLayout is to IDE supported visual layouts.

 

  Important! MiGLayout in Java 7 and SWT/Eclipse
 

MiGLayout was created to solve the layout issue for Swing. It is future proof since it has support for different units, Hi-DPI layouts and plugability - among other things. Basically it is so extensible that there should be little need for any other layout manager besides Matisse/GroupLayout which is used for visual layout editing. If you want to tell Sun that MiGLayout should be considered for inclusion in JDK 7, so that all developers can benefit from it, you should cast your Vote to Include MiGLayout in Java 7.0. You need to register, but that is free, just like MiGLayout. Note that you have 3 votes at your disposal!

SWT/Eclipse Support. MiGLayout is already on the top ten list of feature enhancements for SWT/Eclipse. If you are an SWT/Eclipse user or developer, please go over to the Eclipse Bugzilla site and cast your vote.

 

  MiGLayout is Free and Open Source
 

MiGLayout is free to use for commercial and non-commercial projects and the source code is provided. It is licensed under the very free BSD or GPL license, whichever you prefer. We would be glad if you told us about where it is used though and testimonials are especially appreciated. Please spread the word if you like MiGLayout! Likewise we welcome bug reports and feedback at our forums under the MiG Layout section. It will lead to improvements, we promise. As with all MiG Products we have a Zero Bugs Policy!Support This Project

Why not help this project -->

 

  MiGLayout Downloads
 

New! Downloads Folder (Latest is v3.7.2 released on 2009-12-22) Change Log

Users using Maven, please go to the MiG Layout Maven Site.

Subversion access through: svn://mig-svn.no-ip.org/miglayout2

Quick Start Guide: (PDF)

Cheat Sheet: (PDF / HTML)

White Paper: (HTML)

API JavaDoc: (HTML)

JavaFX version is a part of the JFXtras project.

MiG Layout works with: Sun Java 1.4, 5.0, 6.0. IBM Java 1.4+, Excelsior JET Ahead of Time Compiler Excelsior JET

  Demo Applications with Source Code for Swing and SWT
 

For the demo applications to work you need to have Java 1.4 or later installed. The Swing version is sand boxed and thus needs no permissions and is therefore completely safe. The SWT version will need full permissions, as all SWT applications do.

Swing Demo
Callback Dock Demo
SWT Demo for Windows
HiDPI Simulator
MiG Layout Swing Demo
MiG Layout Callback Demo
swt
swt

 

  Using the MiGLayout Demos for GUI Benchmarking
 

The demo applications can be used for GUI benchmarking. You can for instance measure the difference between SWT and Swing or how the different versions of Java measure up. You can even set another Look&Feel for the Swing version and measure the speed of the widget creation and rendering.

To run the demos in benchmarking mode you have to download the .jar(s) from above. Note that you need the .dll to be in the current directory when running the SWT version. It is not needed for the Swing version.

Run the .jar with "java -jar swingdemoapp.jar -help" or "java -jar swtdemoapp.jar -help" and the usage and examples are shown.

If you want to run the SWT benchmark under Linux or OS X you will need the swtdemoappbase.jar as well as the correct swt.jar and any required native libraries. They are provided on the eclipse site.

 

  Getting Started with MiG Layout
 

It is really simple to get started with MiGLayout. All you need to do is to download the correct .jar from above and add it to you classpath. That's it!

You should read the white paper linked above. It contains all you need to know. You might also want to look at the source code for for the demo applications. In the Swing version of the demo application you can right-click any component or container and change the constraints. It is a good way to learn by trial-and-error.

Printing the Cheat Sheet is a good idea since it gives you all the keywords in a short and simple list.

To give you an idea about how the layout manager works, below is the source code for the Quick Start panel. Note that all gaps (white space) is added automatically. The gaps will be correct for the platform it is run. Even the white space around the components (border) is automatic!

    JPanel panel = new JPanel(new MigLayout());

    panel.add(firstNameLabel);
    panel.add(firstNameTextField);
    panel.add(lastNameLabel,       "gap unrelated");
    panel.add(lastNameTextField,   "wrap");
    panel.add(addressLabel);
    panel.add(addressTextField,    "span, grow");

 

That code produces this panel:

mig layout quickstart panel

 

  Support and Help
 

You can post questions and comments at our forums under the MiG Layout section.

You can find more components from MiG InfoCom at the MiG Components and MiG Java Calendar sites.

 

© 2007 MiG InfoCom AB