本文整理汇总了Java中java.awt.peer.MenuItemPeer.setLabel方法的典型用法代码示例。如果您正苦于以下问题:Java MenuItemPeer.setLabel方法的具体用法?Java MenuItemPeer.setLabel怎么用?Java MenuItemPeer.setLabel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.peer.MenuItemPeer
的用法示例。
在下文中一共展示了MenuItemPeer.setLabel方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setLabel
import java.awt.peer.MenuItemPeer; //导入方法依赖的package包/类
/**
* Sets the label for this menu item to the specified label.
* @param label the new label, or <code>null</code> for no label.
* @see java.awt.MenuItem#getLabel
* @since JDK1.0
*/
public synchronized void setLabel(String label) {
this.label = label;
MenuItemPeer peer = (MenuItemPeer)this.peer;
if (peer != null) {
peer.setLabel(label);
}
}
示例2: deleteShortcut
import java.awt.peer.MenuItemPeer; //导入方法依赖的package包/类
/**
* Delete any <code>MenuShortcut</code> object associated
* with this menu item.
* @since JDK1.1
*/
public void deleteShortcut() {
shortcut = null;
MenuItemPeer peer = (MenuItemPeer)this.peer;
if (peer != null) {
peer.setLabel(label);
}
}
示例3: setLabel
import java.awt.peer.MenuItemPeer; //导入方法依赖的package包/类
/**
* Sets the label for this menu item to the specified label.
* @param label the new label, or {@code null} for no label.
* @see java.awt.MenuItem#getLabel
* @since 1.0
*/
public synchronized void setLabel(String label) {
this.label = label;
MenuItemPeer peer = (MenuItemPeer)this.peer;
if (peer != null) {
peer.setLabel(label);
}
}
示例4: deleteShortcut
import java.awt.peer.MenuItemPeer; //导入方法依赖的package包/类
/**
* Delete any {@code MenuShortcut} object associated
* with this menu item.
* @since 1.1
*/
public void deleteShortcut() {
shortcut = null;
MenuItemPeer peer = (MenuItemPeer)this.peer;
if (peer != null) {
peer.setLabel(label);
}
}
示例5: setLabel
import java.awt.peer.MenuItemPeer; //导入方法依赖的package包/类
/**
* This method sets the label for this menu to the specified value.
*
* @param label The new label for this menu item.
*/
public synchronized void
setLabel(String label)
{
this.label = label;
if (peer != null)
{
MenuItemPeer mp = (MenuItemPeer) peer;
mp.setLabel (label);
}
}
示例6: setLabel
import java.awt.peer.MenuItemPeer; //导入方法依赖的package包/类
/**
* Sets the label for this menu item to the specified label.
* @param label the new label, or <code>null</code> for no label.
* @see java.awt.MenuItem#getLabel
* @since JDK1.0
*/
public synchronized void setLabel(String label) {
this.label = label;
MenuItemPeer peer = (MenuItemPeer)this.peer;
if (peer != null) {
peer.setLabel(label);
}
}
示例7: deleteShortcut
import java.awt.peer.MenuItemPeer; //导入方法依赖的package包/类
/**
* Delete any <code>MenuShortcut</code> object associated
* with this menu item.
* @since JDK1.1
*/
public void deleteShortcut() {
shortcut = null;
MenuItemPeer peer = (MenuItemPeer)this.peer;
if (peer != null) {
peer.setLabel(label);
}
}
示例8: setShortcut
import java.awt.peer.MenuItemPeer; //导入方法依赖的package包/类
/**
* Set the <code>MenuShortcut</code> object associated with this
* menu item. If a menu shortcut is already associated with
* this menu item, it is replaced.
* @param s the menu shortcut to associate
* with this menu item.
* @see java.awt.MenuItem#getShortcut
* @since JDK1.1
*/
public void setShortcut(MenuShortcut s) {
shortcut = s;
MenuItemPeer peer = (MenuItemPeer)this.peer;
if (peer != null) {
peer.setLabel(label);
}
}
示例9: setShortcut
import java.awt.peer.MenuItemPeer; //导入方法依赖的package包/类
/**
* Set the {@code MenuShortcut} object associated with this
* menu item. If a menu shortcut is already associated with
* this menu item, it is replaced.
* @param s the menu shortcut to associate
* with this menu item.
* @see java.awt.MenuItem#getShortcut
* @since 1.1
*/
public void setShortcut(MenuShortcut s) {
shortcut = s;
MenuItemPeer peer = (MenuItemPeer)this.peer;
if (peer != null) {
peer.setLabel(label);
}
}
示例10: setShortcut
import java.awt.peer.MenuItemPeer; //导入方法依赖的package包/类
/**
* Set the <code>MenuShortcut</code> object associated with this
* menu item. If a menu shortcut is already associated with
* this menu item, it is replaced.
* @param s the menu shortcut to associate
* with this menu item.
* @see java.awt.MenuItem#getShortcut
* @since JDK1.1
*/
public void setShortcut(MenuShortcut s) {
shortcut = s;
MenuItemPeer peer = (MenuItemPeer)this.peer;
if (peer != null) {
peer.setLabel(label);
}
}