我正在尝试使用更改 AWT 菜单栏中的字体MenuBar.setFont()
。该调用适用于菜单栏的子菜单,但菜单栏本身不会更改字体(我正在尝试使字体变大)。
有谁知道这是否可行?
我在 Windows XP 上使用 JRE 1.6。
更新:只要文本适合菜单栏高度,更改字体似乎确实有效,否则字体大小会减小。
Use Swing. I don't think that AWT is capable of restyling native component peers in a reliable fashion. I know for certain that SWT can't, and it's a far more sophisticated toolkit than AWT. This is part of why it was essentially deprecated (in favor of Swing) back in Java 1.2.