GithubHelp home page GithubHelp logo

Comments (4)

JFormDesigner avatar JFormDesigner commented on September 15, 2024

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.

JFormDesigner avatar JFormDesigner commented on September 15, 2024

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.

tobium avatar tobium commented on September 15, 2024

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.

tbee avatar tbee commented on September 15, 2024

Integrated into the JDK... Hm, it is a recognition, but it would stifle any development.

from miglayout.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.