Skip to content

Latest commit

 

History

History
34 lines (25 loc) · 2.38 KB

File metadata and controls

34 lines (25 loc) · 2.38 KB

Overview

  1. MigLayout notes

General

  1. Can handle Grid-based, Flow layout, docking layout, Absolute positioning, and Relative positioning
  2. String based config is more compact
    1. Invalid strings throw RuntimeException
  3. API based config is more typesafe
  4. Unlike SpringLayout and GroupLayout, component constraints are set using .add(component, ...)
    1. Layout constraints are set when constructing the MigLayout
  5. Comes with helpful debug features
  6. Replace BorderLayout using Docking
  7. Replace FlowLayout using nogrid
    1. MigLayout can also flow vertically (via flowy) unlike FlowLayout
    2. TODO: I couldn't get this to work

Constraint types

  1. LC means component layout constraint (highest level)
    1. see debug
  2. AC means component axis constraint (either column or row)
  3. CC means component constraint (lowest level)
    1. Useful for overriding minimum/preferred/maximum constraints
    2. Useful for alignment when spanning/splitting cells

Gotchas

  1. Centering a JLabel or JTextField requires setHorizontalAlignment(SwingConstants.CENTER)

Other Resources

  1. TODO