开发者

How can i set the proper font for java application on windows and mac?

开发者 https://www.devze.com 2023-01-16 16:26 出处:网络
I have been developing a program on a windows machine. All dimensions for the application are based on the default window开发者_高级运维s font and size.

I have been developing a program on a windows machine. All dimensions for the application are based on the default window开发者_高级运维s font and size. The default mac font seems to be larger in size, therefore not all text is visible in labels, comboboxes, ... How can i make sure that the proper font size is used on mac machines?


The correct way to do it is not to hardcode control sizes and use layout managers instead.


Michael is right. Font sizes are not the only thing changing from one L&F to the other. Components like buttons can have different sizes too. So forget about hardcoded sizes. With Apple's control styles, developers now have a chance to choose the size of some components, but there is no guarantee this will work in the future if your layout is not flexible.

0

精彩评论

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