开发者

Java Layout difference on identical screen resolutions

开发者 https://www.devze.com 2023-03-13 05:30 出处:网络
I have two screens that are using the same resolution (1280x1024), but one of them has a refresh rate of 59.9 HZ, and the other one has a refresh rate of 75 HZ. I have a full software that\'s develope

I have two screens that are using the same resolution (1280x1024), but one of them has a refresh rate of 59.9 HZ, and the other one has a refresh rate of 75 HZ. I have a full software that's developed using Java (and running under OpenSuse 10.0). The problem is that the Jtables in this software are being displayed differently on both screens: They're being displayed perfectly on one screen, and on the other screen, the widths of the columns are increasing, which is hiding some of the columns. The other difference that I was able to get from both screens, is when I used the Toolkit.getDefaultToolkit().getScreenResolution(), which gave me 93 on the "good display" screen and 95 on the "bad display" screen.

My question is, 开发者_运维问答why would two screens that are using the same resolution, display GUI components differently? Does it have to do anything with the refresh rate or with the DPI of the screen?


Check your available fonts. The logical font names (serif, sansserif, monospaced, dialog, dialoginput) are created from the fonts available on your machine.

Per the Font javadoc:

Typically, each logical font name maps to several physical fonts in order to cover a large range of characters.

So, if the available fonts do not match, Java may be substituting different physical font characters. That can cause the behavior you are describing.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号