tags:

views:

556

answers:

1

I'm trying to change the font in an AWT menu bar using MenuBar.setFont(). The call works for the menu bar's child menus, but the menu bar itself doesn't change font (I'm trying to make the font larger).

Does anyone know whether this is possible to do?

I'm using JRE 1.6 on Windows XP.

Update: Changing the font does seem to work so long as the text fits within the menu bar height, otherwise the font size is reduced.

+1  A: 

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.

Daniel Spiewak
Thanks for your response Daniel.Unfortunately I'm stuck with AWT on this particular window because it uses JFlashPlayer which doesn't play happily with Swing menus (from memory I think the drop-down menus end up drawing behind the Flash plugin)