Java Code Examples for java.awt.peer.MenuItemPeer#setLabel()

The following examples show how to use java.awt.peer.MenuItemPeer#setLabel() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MenuItem.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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);
    }
}
 
Example 2
Source File: MenuItem.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
void deleteShortcut(MenuShortcut s) {
    if (s.equals(shortcut)) {
        shortcut = null;
        MenuItemPeer peer = (MenuItemPeer)this.peer;
        if (peer != null) {
            peer.setLabel(label);
        }
    }
}
 
Example 3
Source File: MenuItem.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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);
    }
}
 
Example 4
Source File: MenuItem.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * 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);
    }
}
 
Example 5
Source File: MenuItem.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
void deleteShortcut(MenuShortcut s) {
    if (s.equals(shortcut)) {
        shortcut = null;
        MenuItemPeer peer = (MenuItemPeer)this.peer;
        if (peer != null) {
            peer.setLabel(label);
        }
    }
}
 
Example 6
Source File: MenuItem.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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);
    }
}
 
Example 7
Source File: MenuItem.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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);
    }
}
 
Example 8
Source File: MenuItem.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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);
    }
}
 
Example 9
Source File: MenuItem.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
void deleteShortcut(MenuShortcut s) {
    if (s.equals(shortcut)) {
        shortcut = null;
        MenuItemPeer peer = (MenuItemPeer)this.peer;
        if (peer != null) {
            peer.setLabel(label);
        }
    }
}
 
Example 10
Source File: MenuItem.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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);
    }
}
 
Example 11
Source File: MenuItem.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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);
    }
}
 
Example 12
Source File: MenuItem.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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);
    }
}
 
Example 13
Source File: MenuItem.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
void deleteShortcut(MenuShortcut s) {
    if (s.equals(shortcut)) {
        shortcut = null;
        MenuItemPeer peer = (MenuItemPeer)this.peer;
        if (peer != null) {
            peer.setLabel(label);
        }
    }
}
 
Example 14
Source File: MenuItem.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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);
    }
}
 
Example 15
Source File: MenuItem.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * 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);
    }
}
 
Example 16
Source File: MenuItem.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * 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);
    }
}
 
Example 17
Source File: MenuItem.java    From TencentKona-8 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * 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);
    }
}
 
Example 18
Source File: MenuItem.java    From jdk8u_jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * 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);
    }
}
 
Example 19
Source File: MenuItem.java    From JDKSourceCode1.8 with MIT License 3 votes vote down vote up
/**
 * 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);
    }
}
 
Example 20
Source File: MenuItem.java    From jdk1.8-source-analysis with Apache License 2.0 3 votes vote down vote up
/**
 * 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);
    }
}