Links

  • 1. Sogeti
  • 2. JBoss
  • 3. IBM
  • 4. Oracle
  • 5. SpringSource
  • 6. NL-JUG
  • 7. Java

Archives

Syndication  RSS 2.0

RSS 1.0
RSS 2.0

Bookmark this site

Add 'JCN Blog' site to delicious  Add 'JCN Blog' site to technorati  Add 'JCN Blog' site to digg  Add 'JCN Blog' site to dzone

Posted by Patrick Kik at 19:11 on Wednesday 16 March    Add 'MiGLayout – The Java Layout Manager for Swing, SWT and JavaFX' site to delicious  Add 'MiGLayout – The Java Layout Manager for Swing, SWT and JavaFX' site to technorati  Add 'MiGLayout – The Java Layout Manager for Swing, SWT and JavaFX' site to digg  Add 'MiGLayout – The Java Layout Manager for Swing, SWT and JavaFX' site to dzone

I’m not a fan of developing user interfaces and that’s an understatement. I really hate the Swing layout managers. But then I discovered MiGLayout!

With MiGLayout it’s really easy to create a GUI. Here’s a short example (from their website):

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");

Take a look at the demo applications to see a lot of examples using MiGLayout.


© 2004 - 2008 Java Competence Network. All Rights Reserved.