Reputation: 1453
In my project I want to display icons on the right side of JMenuItem
entries. Below is my code, but it displays icon on the left side of menu items.
Icon student2 = new ImageIcon(getClass().getResource("images/new-student.png"));
JMenuItem student = new JMenuItem("New students",student1);
Upvotes: 0
Views: 776
Reputation: 324128
i want to display icons on the right side of jemnu items
Try:
JMenuItem student = new JMenuItem(...);
student.setComponentOrientation(JComponent.ComponentOrientation.RIGHT_TO_LEFT);
Upvotes: 2