Font looks different between eclipse launched window and jar launched window

93 Views Asked by At

This is the look when launched in eclipse

1

while below is what I opened from a jar (but same code)

2

And here is the setting. The systemLookAndFeel in this case is winXP.

try {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception ex) {
    Log.toConsole(ex.getMessage());
}

After some research, I found that the default font of JTextArea is MonoSpaced and it is a logical font which means the realization depends on system. But whenever I changed to another font, the line-distance become very small looking not good.

What can you think about? I have tried font and font size which turned out to be useless. If you need other infomations just comment. Thank you.

(I delete the last post because the website I uploaded my pictures forbids links from other sites)

1

There are 1 best solutions below

0
On

I suggest you to use .setFont() for components you are using