List of usage examples for java.awt MenuItem setName
public void setName(String name)
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//from w w w .j a va 2 s . c o m * @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); } }