Comments (4)
This is because MigLayout uses logical pixels by default, which depend on screen DPI. Looking at the large Windows border in your screen shot, it seems that is uses larger DPI than your Mac.
If you want use real pixels, try
this.add(label, "x 0, y 0, w 250px, h 200px");
Or change the default unit to real pixels:
PlatformDefaults.setDefaultHorizontalUnit(UnitValue.PIXEL);
PlatformDefaults.setDefaultVerticalUnit(UnitValue.PIXEL);
You could also indicate that the size of a logical pixel should always be a real pixel with:
PlatformDefaults.setLogicalPixelBase( PlatformDefaults.BASE_REAL_PIXEL );
from miglayout.
BTW would be interesting to know what Java version you use and the resolution of your screen.
Also a screenshot comparing a Java button with a native Windows button (to see any difference in size).
from miglayout.
Thank you JFormDesigner :) After debugging through the code I found this PIXEL vs. LPX difference ;)
So after setting the default unit, everything works fine - in the same manner like MigLayout 4.
But is it a good idea to switch the default unit between ML4 and 5 from PX to LPX? It could be confusing for many people like me ;)
Thank you for your help. MigLayout is the best layout manager available. So I hope one day MigLayout is as popular as the built-in layout manager - or even better - will be integrated in the offiical JDK...
Best,
Tobi
btw: I used Java 1.8.0_60 and 1.6 on MacBook Pro Retina....1400x900 (@2x)
from miglayout.
Integrated into the JDK... Hm, it is a recognition, but it would stifle any development.
from miglayout.
Related Issues (20)
- Confusing version difference between home page, Github and Maven HOT 2
- Thank you for this update !!! HOT 1
- Expose boundsInGrid within CC? HOT 2
- Is it possible to expose and use ids when layouts are shared? HOT 2
- Migpane problem with size HOT 6
- set fill on component HOT 1
- Release version number confusion 5.2 or 5.3? HOT 1
- Build error running on OSX
- 5.3 release on Maven central before requiring Java 11 ? HOT 2
- SWT: Debug lines don't show up on macOS HOT 1
- Statement is always true HOT 2
- Some absolute positions should not affect min/preferred size
- MigLayout V11.0 release notes HOT 4
- Exception in thread "main" java.lang.NoSuchFieldError: VISUAL_PADDING_PROPERTY
- constructor row constraint is not applied to all rows
- MigPane: AC.constaints should be renamed to AC.constraints (for usage in FXML) HOT 3
- Bug: unable to set logical pixel base to base real pixel HOT 8
- Consider adding ErrorProne for capturing bad coding patterns during the build HOT 12
- Run CI tests for PRs HOT 1
- migcomponents.com is down HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from miglayout.