-
Bug
-
Resolution: Fixed
-
P3
-
1.3.1, 6, 7, 8
-
b01
-
generic
-
generic
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8173486 | 7u171 | Mikhail Cherkasov | P5 | Resolved | Fixed | b01 |
JDK-8182225 | 7u161 | Unassigned | P3 | Resolved | Fixed | b01 |
JDK-8177260 | 7u151 | Unassigned | P3 | Resolved | Fixed | b01 |
JDK-8174004 | 7u141 | Mikhail Cherkasov | P3 | Resolved | Fixed | b06 |
JDK-8180977 | openjdk7u | Sergey Bylokhov | P3 | Resolved | Fixed | master |
JDK-8188402 | 6u181 | Unassigned | P3 | Resolved | Fixed | b01 |
JDK-8173579 | 6u171 | Mikhail Cherkasov | P5 | Resolved | Fixed | b01 |
JDK-8177234 | 6u161 | Unassigned | P3 | Resolved | Fixed | b01 |
JDK-8173997 | 6u151 | Mikhail Cherkasov | P3 | Resolved | Fixed | b06 |
This has been the case for quite some time now.
The following test case can be used to demonstrate the problem on top-level Menus.
------------------
import java.awt.*;
import java.awt.event.*;
public class MenuTest {
private static Font bigFont = new Font("Dialog", Font.PLAIN, 48);
private static Font smallFont = new Font("Dialog", Font.PLAIN, 18);
public static void main(String[] args) {
Frame f = new Frame("MenuTest 1");
MenuBar mb = new MenuBar();
mb.setFont(bigFont);
mb.add(createMenu("Big Menu with really long title", bigFont));
mb.add(createMenu("Small Menu", smallFont));
mb.add(createMenu("Normal Menu", null));
f.setMenuBar(mb);
//f.pack();
f.setSize(600, 600);
f.setVisible(true);
}
private static Menu createMenu(String name, Font font) {
Menu m = new Menu(name);
m.setFont(font);
for (int i = 0; i < 5; i++) {
m.add(new MenuItem("MenuItem " + i));
}
m.add(new MenuActionListener("Set Big Font", bigFont));
m.add(new MenuActionListener("Set Small Font", smallFont));
return m;
}
private static class MenuActionListener extends MenuItem implements ActionListener {
private Font font;
public MenuActionListener(String name, Font f) {
super(name);
font = f;
addActionListener(this);
}
public void actionPerformed(ActionEvent e) {
MenuContainer mc = getParent();
if (mc instanceof MenuComponent) {
((MenuComponent)mc).setFont(font);
}
/* work-around
if (mc instanceof MenuItem) {
((MenuItem)mc).setLabel(((MenuItem)mc).getLabel());
}
*/
}
}
}
- backported by
-
JDK-8173997 setFont() does not update Fonts of Menus already on screen
- Resolved
-
JDK-8174004 setFont() does not update Fonts of Menus already on screen
- Resolved
-
JDK-8177234 setFont() does not update Fonts of Menus already on screen
- Resolved
-
JDK-8177260 setFont() does not update Fonts of Menus already on screen
- Resolved
-
JDK-8180977 setFont() does not update Fonts of Menus already on screen
- Resolved
-
JDK-8182225 setFont() does not update Fonts of Menus already on screen
- Resolved
-
JDK-8188402 setFont() does not update Fonts of Menus already on screen
- Resolved
-
JDK-8173486 setFont() does not update Fonts of Menus already on screen
- Resolved
-
JDK-8173579 setFont() does not update Fonts of Menus already on screen
- Resolved
- relates to
-
JDK-4414599 awt.MenuBar setFont() works incorrectly
- Resolved