How can i set the proper font for java application on windows and mac?
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.
精彩评论