-
Type:
Bug
-
Resolution: Duplicate
-
Priority:
P3
-
None
-
Affects Version/s: 17.0.17
-
Component/s: client-libs
-
x86_64
-
windows_10
ADDITIONAL SYSTEM INFORMATION :
Windows 11.
A DESCRIPTION OF THE PROBLEM :
Icon is painted shifted to the right, compared to the previous version 17.0.16.
REGRESSION : Last worked in version 17
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Start test snippet on Windows with 17.0.16 and 17.0.17. Observe the differences.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
icon at same position as in 17.0.16
ACTUAL -
menu item icon shifted to the right.
---------- BEGIN SOURCE ----------
public class Snippet {
public static void main(String[] args) throws Exception {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
System.out.println(System.getProperty("java.version"));
JFrame f = new JFrame();
JMenu menu = new JMenu("File");
JMenuItem item = new JMenuItem("Menu Item");
item.setIcon(UIManager.getIcon("Tree.closedIcon"));
menu.add(item);
JMenuBar bar = new JMenuBar();
bar.add(menu);
f.setJMenuBar(bar);
f.setSize(800, 600);
f.setLocationRelativeTo(null);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setVisible(true);
}
}
---------- END SOURCE ----------
Windows 11.
A DESCRIPTION OF THE PROBLEM :
Icon is painted shifted to the right, compared to the previous version 17.0.16.
REGRESSION : Last worked in version 17
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Start test snippet on Windows with 17.0.16 and 17.0.17. Observe the differences.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
icon at same position as in 17.0.16
ACTUAL -
menu item icon shifted to the right.
---------- BEGIN SOURCE ----------
public class Snippet {
public static void main(String[] args) throws Exception {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
System.out.println(System.getProperty("java.version"));
JFrame f = new JFrame();
JMenu menu = new JMenu("File");
JMenuItem item = new JMenuItem("Menu Item");
item.setIcon(UIManager.getIcon("Tree.closedIcon"));
menu.add(item);
JMenuBar bar = new JMenuBar();
bar.add(menu);
f.setJMenuBar(bar);
f.setSize(800, 600);
f.setLocationRelativeTo(null);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setVisible(true);
}
}
---------- END SOURCE ----------
- duplicates
-
JDK-8370945 With Windows LAF, the location of a JMenuItem icon is incorrect
-
- Closed
-