在我的项目中,我想在 JMenuItem
条目的右侧显示图标。下面是我的代码,但它在菜单项的左侧显示图标。
Icon student2 = new ImageIcon(getClass().getResource("images/new-student.png"));
JMenuItem student = new JMenuItem("New students",student1);
最佳答案
i want to display icons on the right side of jemnu items
尝试:
JMenuItem student = new JMenuItem(...);
student.setComponentOrientation(JComponent.ComponentOrientation.RIGHT_TO_LEFT);
关于java - 如何在菜单项的右侧显示图标?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29611039/