How can I display an image instead of text in a menu?

Chandra Patni

You can simply use this code to create a JMenu with icon.

JMenu menu = new JMenu();
menu.setIcon(new ImageIcon("App.gif"));

If you want no text in the menu, simply set its text to null.

0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact