serg kunz
serg kunz

Reputation: 531

MigLayout: how to change default “related” and “unrelated” gap values?

It is a nice feature to use “related” and “unrelated” gap values in the MigLayout container, but I would like to change their default values. How to do that? I don’t like to use explicit numbers, e.g. “wrap 15px”. “wrap related” is more flexible and readable.

Upvotes: 1

Views: 251

Answers (1)

kleopatra
kleopatra

Reputation: 51525

Have a look at the class PlatformDefaults: it has api to customize (nearly) all semantically known unitValues, f.i. to set the unrelated gap for both x/y

UnitValue myGap = new UnitValue(15, UnitValue.LPX, null);
PlatformDefaults.setUnrelatedGap(myGap, myGap);

Beware, though: the default values are those which the per-OS guidelines require, if you change them your ui will violate those guidelines!

Upvotes: 1

Related Questions