List of usage examples for java.awt MenuItem setLabel
public synchronized void setLabel(String label)
From source file:net.java.sip.communicator.impl.osdependent.jdic.TrayMenuFactory.java
/** * Changes the tray menu item properties, like name, text and icon. * @param trayItem the tray menu item to change * @param name the new name of the item/* www.j a v a2 s . c om*/ * @param textID the new text identifier * @param iconID the new icon string identifier */ private static void changeTrayMenuItem(Object trayItem, String name, String textID, String iconID) { String text = Resources.getString(textID); if (trayItem instanceof JMenuItem) { JMenuItem jmenuItem = (JMenuItem) trayItem; jmenuItem.setName(name); jmenuItem.setText(text); jmenuItem.setIcon(Resources.getImage(iconID)); } else if (trayItem instanceof MenuItem) { MenuItem menuItem = (MenuItem) trayItem; menuItem.setName(name); menuItem.setLabel(text); } }