Miglayout with the native look and feel has differing behavior

144 views Asked by At

I've been searching for a nice Java look and feel and native always seems best to me.

The problem: The layouts look different on different platforms.

I am pretty much using miglayout for almost everything - it works perfect for the Windows native theme - but on Macs, and Linux, some fields are waaay out of wack.

For instance the height of a JTextField is so tiny on the Mac and Linux look and feels that the text is barely visible, it looks normal on windows.

Preferred sizes are sometimes completely ignored on the Mac and Linux look and feels and items get stretched off screen.

I'm not sure how to solve this problem~

If anyone has any tips I'd be delighted.

1

There are 1 answers

0
Matt Hubbard On

I'm not sure if this will solve it, but it might help.

try {
        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    } catch (ClassNotFoundException | InstantiationException |   IllegalAccessException | UnsupportedLookAndFeelException ex) {
    }