-
Bug
-
Resolution: Not an Issue
-
P4
-
None
-
1.2.2
-
x86
-
windows_98
Name: skT88420 Date: 07/09/99
Regardless of the font setting on a JMenuItem, if an accelerator
shortcut is available for it, the shortcut is rendered in some font
which is apparently constant and unchangeable.
This bug has been untested on OSes other than Win98. It also has not
been tested under JDK 1.2.2. It has, however, been tested using both
Metal and Windows look-and-feels, by commenting out a portion of the
code shown below.
import javax.swing.*;
import java.awt.*;
public class Test
{
public static void main (String[] args)
{
// comment this out on a Windows box to try Metal L&F
try {
UIManager.setLookAndFeel
(UIManager.getSystemLookAndFeelClassName());
} catch (Exception ex) { ex.printStackTrace(); }
// comment this out on a Windows box to try Metal L&F
JFrame frame = new JFrame();
Container content = frame.getContentPane();
content.add(new JButton("for kicks"));
JMenuItem menuitem = new JMenuItem ("Item");
menuitem.setAccelerator (
KeyStroke.getKeyStroke ('I', Event.ALT_MASK));
menuitem.setFont (new Font ("SansSerif", Font.PLAIN, 24));
JMenu menu = new JMenu ("Menu");
menu.add (menuitem);
JMenuBar menubar = new JMenuBar();
menubar.add (menu);
frame.setJMenuBar (menubar);
frame.pack();
frame.show();
}
}
(Review ID: 85416)
======================================================================