miglayout icon indicating copy to clipboard operation
miglayout copied to clipboard

Spacing in 5.0 for swing much greater

Open tbee opened this issue 9 years ago • 4 comments

I recently upgraded one of my applications to MigLayout 5.0 and the users complain that the fields didn't fit on the screen anymore. Attached are screenshots of the same screen under 3.7.3, 4.2 and 5.0 and it is clearly visible under 5.0 the spacing is almost double.

3 7 3 4 2 5 0

tbee avatar Feb 17 '16 11:02 tbee

I think the gaps are larger since this commit 3dcc68737bec6dfe188a4bad8db372be280283c4

You can restore the old gaps in your app:

PlatformDefaults.setRelatedGap(LPX4, LPY4);
PlatformDefaults.setUnrelatedGap(LPX7, LPY9);
PlatformDefaults.setParagraphGap(LPX14, LPY14);
PlatformDefaults.setIndentGap(LPX9, LPY9);
PlatformDefaults.setGridCellGap(LPX4, LPY4);

JFormDesigner avatar Feb 17 '16 11:02 JFormDesigner

That commit indeed has a big space increase.

tbee avatar Feb 17 '16 12:02 tbee

Hello, I think I am experiencing a similar problem. I am using MigLayout and it is frequently creating too much space between components. When I copied in the 5 lines you have above @JFormDesigner Java told me it couldn't find any of the symbols, including PlatformDefaults.

andrewmathies avatar Jul 27 '17 18:07 andrewmathies

With MigLayout 11.0 I fixed the Problem for Windows Swing with PlatformDefaults.setRelatedGap( new UnitValue(4, UnitValue.LPX, null), new UnitValue(4, UnitValue.LPY, null)); PlatformDefaults.setUnrelatedGap( new UnitValue(7, UnitValue.LPX, null), new UnitValue(9, UnitValue.LPY, null)); PlatformDefaults.setParagraphGap( new UnitValue(14, UnitValue.LPX, null), new UnitValue(14, UnitValue.LPY, null)); PlatformDefaults.setIndentGap( new UnitValue(9, UnitValue.LPX, null), new UnitValue(9, UnitValue.LPY, null)); PlatformDefaults.setGridCellGap( new UnitValue(4, UnitValue.LPX, null), new UnitValue(4, UnitValue.LPY, null)); in a static block.

aley2003 avatar Dec 28 '22 08:12 aley2003