Java Code Examples for java.awt.peer.TrayIconPeer#displayMessage()

The following examples show how to use java.awt.peer.TrayIconPeer#displayMessage() . 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: TrayIcon.java    From jdk8u-jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Displays a popup message near the tray icon.  The message will
 * disappear after a time or if the user clicks on it.  Clicking
 * on the message may trigger an {@code ActionEvent}.
 *
 * <p>Either the caption or the text may be <code>null</code>, but an
 * <code>NullPointerException</code> is thrown if both are
 * <code>null</code>.
 *
 * When displayed, the caption or text strings may be truncated on
 * some platforms; the number of characters that may be displayed is
 * platform-dependent.
 *
 * <p><strong>Note:</strong> Some platforms may not support
 * showing a message.
 *
 * @param caption the caption displayed above the text, usually in
 * bold; may be <code>null</code>
 * @param text the text displayed for the particular message; may be
 * <code>null</code>
 * @param messageType an enum indicating the message type
 * @throws NullPointerException if both <code>caption</code>
 * and <code>text</code> are <code>null</code>
 */
public void displayMessage(String caption, String text, MessageType messageType) {
    if (caption == null && text == null) {
        throw new NullPointerException("displaying the message with both caption and text being null");
    }

    TrayIconPeer peer = this.peer;
    if (peer != null) {
        peer.displayMessage(caption, text, messageType.name());
    }
}
 
Example 2
Source File: TrayIcon.java    From jdk8u-dev-jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Displays a popup message near the tray icon.  The message will
 * disappear after a time or if the user clicks on it.  Clicking
 * on the message may trigger an {@code ActionEvent}.
 *
 * <p>Either the caption or the text may be <code>null</code>, but an
 * <code>NullPointerException</code> is thrown if both are
 * <code>null</code>.
 *
 * When displayed, the caption or text strings may be truncated on
 * some platforms; the number of characters that may be displayed is
 * platform-dependent.
 *
 * <p><strong>Note:</strong> Some platforms may not support
 * showing a message.
 *
 * @param caption the caption displayed above the text, usually in
 * bold; may be <code>null</code>
 * @param text the text displayed for the particular message; may be
 * <code>null</code>
 * @param messageType an enum indicating the message type
 * @throws NullPointerException if both <code>caption</code>
 * and <code>text</code> are <code>null</code>
 */
public void displayMessage(String caption, String text, MessageType messageType) {
    if (caption == null && text == null) {
        throw new NullPointerException("displaying the message with both caption and text being null");
    }

    TrayIconPeer peer = this.peer;
    if (peer != null) {
        peer.displayMessage(caption, text, messageType.name());
    }
}
 
Example 3
Source File: TrayIcon.java    From jdk-1.7-annotated with Apache License 2.0 3 votes vote down vote up
/**
 * Displays a popup message near the tray icon.  The message will
 * disappear after a time or if the user clicks on it.  Clicking
 * on the message may trigger an {@code ActionEvent}.
 *
 * <p>Either the caption or the text may be <code>null</code>, but an
 * <code>NullPointerException</code> is thrown if both are
 * <code>null</code>.
 *
 * When displayed, the caption or text strings may be truncated on
 * some platforms; the number of characters that may be displayed is
 * platform-dependent.
 *
 * <p><strong>Note:</strong> Some platforms may not support
 * showing a message.
 *
 * @param caption the caption displayed above the text, usually in
 * bold; may be <code>null</code>
 * @param text the text displayed for the particular message; may be
 * <code>null</code>
 * @param messageType an enum indicating the message type
 * @throws NullPointerException if both <code>caption</code>
 * and <code>text</code> are <code>null</code>
 */
public void displayMessage(String caption, String text, MessageType messageType) {
    if (caption == null && text == null) {
        throw new NullPointerException("displaying the message with both caption and text being null");
    }

    TrayIconPeer peer = this.peer;
    if (peer != null) {
        peer.displayMessage(caption, text, messageType.name());
    }
}
 
Example 4
Source File: TrayIcon.java    From jdk8u-jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Displays a popup message near the tray icon.  The message will
 * disappear after a time or if the user clicks on it.  Clicking
 * on the message may trigger an {@code ActionEvent}.
 *
 * <p>Either the caption or the text may be <code>null</code>, but an
 * <code>NullPointerException</code> is thrown if both are
 * <code>null</code>.
 *
 * When displayed, the caption or text strings may be truncated on
 * some platforms; the number of characters that may be displayed is
 * platform-dependent.
 *
 * <p><strong>Note:</strong> Some platforms may not support
 * showing a message.
 *
 * @param caption the caption displayed above the text, usually in
 * bold; may be <code>null</code>
 * @param text the text displayed for the particular message; may be
 * <code>null</code>
 * @param messageType an enum indicating the message type
 * @throws NullPointerException if both <code>caption</code>
 * and <code>text</code> are <code>null</code>
 */
public void displayMessage(String caption, String text, MessageType messageType) {
    if (caption == null && text == null) {
        throw new NullPointerException("displaying the message with both caption and text being null");
    }

    TrayIconPeer peer = this.peer;
    if (peer != null) {
        peer.displayMessage(caption, text, messageType.name());
    }
}
 
Example 5
Source File: TrayIcon.java    From jdk8u_jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Displays a popup message near the tray icon.  The message will
 * disappear after a time or if the user clicks on it.  Clicking
 * on the message may trigger an {@code ActionEvent}.
 *
 * <p>Either the caption or the text may be <code>null</code>, but an
 * <code>NullPointerException</code> is thrown if both are
 * <code>null</code>.
 *
 * When displayed, the caption or text strings may be truncated on
 * some platforms; the number of characters that may be displayed is
 * platform-dependent.
 *
 * <p><strong>Note:</strong> Some platforms may not support
 * showing a message.
 *
 * @param caption the caption displayed above the text, usually in
 * bold; may be <code>null</code>
 * @param text the text displayed for the particular message; may be
 * <code>null</code>
 * @param messageType an enum indicating the message type
 * @throws NullPointerException if both <code>caption</code>
 * and <code>text</code> are <code>null</code>
 */
public void displayMessage(String caption, String text, MessageType messageType) {
    if (caption == null && text == null) {
        throw new NullPointerException("displaying the message with both caption and text being null");
    }

    TrayIconPeer peer = this.peer;
    if (peer != null) {
        peer.displayMessage(caption, text, messageType.name());
    }
}
 
Example 6
Source File: TrayIcon.java    From openjdk-8 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Displays a popup message near the tray icon.  The message will
 * disappear after a time or if the user clicks on it.  Clicking
 * on the message may trigger an {@code ActionEvent}.
 *
 * <p>Either the caption or the text may be <code>null</code>, but an
 * <code>NullPointerException</code> is thrown if both are
 * <code>null</code>.
 *
 * When displayed, the caption or text strings may be truncated on
 * some platforms; the number of characters that may be displayed is
 * platform-dependent.
 *
 * <p><strong>Note:</strong> Some platforms may not support
 * showing a message.
 *
 * @param caption the caption displayed above the text, usually in
 * bold; may be <code>null</code>
 * @param text the text displayed for the particular message; may be
 * <code>null</code>
 * @param messageType an enum indicating the message type
 * @throws NullPointerException if both <code>caption</code>
 * and <code>text</code> are <code>null</code>
 */
public void displayMessage(String caption, String text, MessageType messageType) {
    if (caption == null && text == null) {
        throw new NullPointerException("displaying the message with both caption and text being null");
    }

    TrayIconPeer peer = this.peer;
    if (peer != null) {
        peer.displayMessage(caption, text, messageType.name());
    }
}
 
Example 7
Source File: TrayIcon.java    From openjdk-8-source with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Displays a popup message near the tray icon.  The message will
 * disappear after a time or if the user clicks on it.  Clicking
 * on the message may trigger an {@code ActionEvent}.
 *
 * <p>Either the caption or the text may be <code>null</code>, but an
 * <code>NullPointerException</code> is thrown if both are
 * <code>null</code>.
 *
 * When displayed, the caption or text strings may be truncated on
 * some platforms; the number of characters that may be displayed is
 * platform-dependent.
 *
 * <p><strong>Note:</strong> Some platforms may not support
 * showing a message.
 *
 * @param caption the caption displayed above the text, usually in
 * bold; may be <code>null</code>
 * @param text the text displayed for the particular message; may be
 * <code>null</code>
 * @param messageType an enum indicating the message type
 * @throws NullPointerException if both <code>caption</code>
 * and <code>text</code> are <code>null</code>
 */
public void displayMessage(String caption, String text, MessageType messageType) {
    if (caption == null && text == null) {
        throw new NullPointerException("displaying the message with both caption and text being null");
    }

    TrayIconPeer peer = this.peer;
    if (peer != null) {
        peer.displayMessage(caption, text, messageType.name());
    }
}
 
Example 8
Source File: TrayIcon.java    From hottub with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Displays a popup message near the tray icon.  The message will
 * disappear after a time or if the user clicks on it.  Clicking
 * on the message may trigger an {@code ActionEvent}.
 *
 * <p>Either the caption or the text may be <code>null</code>, but an
 * <code>NullPointerException</code> is thrown if both are
 * <code>null</code>.
 *
 * When displayed, the caption or text strings may be truncated on
 * some platforms; the number of characters that may be displayed is
 * platform-dependent.
 *
 * <p><strong>Note:</strong> Some platforms may not support
 * showing a message.
 *
 * @param caption the caption displayed above the text, usually in
 * bold; may be <code>null</code>
 * @param text the text displayed for the particular message; may be
 * <code>null</code>
 * @param messageType an enum indicating the message type
 * @throws NullPointerException if both <code>caption</code>
 * and <code>text</code> are <code>null</code>
 */
public void displayMessage(String caption, String text, MessageType messageType) {
    if (caption == null && text == null) {
        throw new NullPointerException("displaying the message with both caption and text being null");
    }

    TrayIconPeer peer = this.peer;
    if (peer != null) {
        peer.displayMessage(caption, text, messageType.name());
    }
}
 
Example 9
Source File: TrayIcon.java    From Java8CN with Apache License 2.0 3 votes vote down vote up
/**
 * Displays a popup message near the tray icon.  The message will
 * disappear after a time or if the user clicks on it.  Clicking
 * on the message may trigger an {@code ActionEvent}.
 *
 * <p>Either the caption or the text may be <code>null</code>, but an
 * <code>NullPointerException</code> is thrown if both are
 * <code>null</code>.
 *
 * When displayed, the caption or text strings may be truncated on
 * some platforms; the number of characters that may be displayed is
 * platform-dependent.
 *
 * <p><strong>Note:</strong> Some platforms may not support
 * showing a message.
 *
 * @param caption the caption displayed above the text, usually in
 * bold; may be <code>null</code>
 * @param text the text displayed for the particular message; may be
 * <code>null</code>
 * @param messageType an enum indicating the message type
 * @throws NullPointerException if both <code>caption</code>
 * and <code>text</code> are <code>null</code>
 */
public void displayMessage(String caption, String text, MessageType messageType) {
    if (caption == null && text == null) {
        throw new NullPointerException("displaying the message with both caption and text being null");
    }

    TrayIconPeer peer = this.peer;
    if (peer != null) {
        peer.displayMessage(caption, text, messageType.name());
    }
}
 
Example 10
Source File: TrayIcon.java    From jdk1.8-source-analysis with Apache License 2.0 3 votes vote down vote up
/**
 * Displays a popup message near the tray icon.  The message will
 * disappear after a time or if the user clicks on it.  Clicking
 * on the message may trigger an {@code ActionEvent}.
 *
 * <p>Either the caption or the text may be <code>null</code>, but an
 * <code>NullPointerException</code> is thrown if both are
 * <code>null</code>.
 *
 * When displayed, the caption or text strings may be truncated on
 * some platforms; the number of characters that may be displayed is
 * platform-dependent.
 *
 * <p><strong>Note:</strong> Some platforms may not support
 * showing a message.
 *
 * @param caption the caption displayed above the text, usually in
 * bold; may be <code>null</code>
 * @param text the text displayed for the particular message; may be
 * <code>null</code>
 * @param messageType an enum indicating the message type
 * @throws NullPointerException if both <code>caption</code>
 * and <code>text</code> are <code>null</code>
 */
public void displayMessage(String caption, String text, MessageType messageType) {
    if (caption == null && text == null) {
        throw new NullPointerException("displaying the message with both caption and text being null");
    }

    TrayIconPeer peer = this.peer;
    if (peer != null) {
        peer.displayMessage(caption, text, messageType.name());
    }
}
 
Example 11
Source File: TrayIcon.java    From openjdk-jdk9 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Displays a popup message near the tray icon.  The message will
 * disappear after a time or if the user clicks on it.  Clicking
 * on the message may trigger an {@code ActionEvent}.
 *
 * <p>Either the caption or the text may be {@code null}, but an
 * {@code NullPointerException} is thrown if both are
 * {@code null}.
 *
 * When displayed, the caption or text strings may be truncated on
 * some platforms; the number of characters that may be displayed is
 * platform-dependent.
 *
 * <p><strong>Note:</strong> Some platforms may not support
 * showing a message.
 *
 * @param caption the caption displayed above the text, usually in
 * bold; may be {@code null}
 * @param text the text displayed for the particular message; may be
 * {@code null}
 * @param messageType an enum indicating the message type
 * @throws NullPointerException if both {@code caption}
 * and {@code text} are {@code null}
 */
public void displayMessage(String caption, String text, MessageType messageType) {
    if (caption == null && text == null) {
        throw new NullPointerException("displaying the message with both caption and text being null");
    }

    TrayIconPeer peer = this.peer;
    if (peer != null) {
        peer.displayMessage(caption, text, messageType.name());
    }
}
 
Example 12
Source File: TrayIcon.java    From Bytecoder with Apache License 2.0 3 votes vote down vote up
/**
 * Displays a popup message near the tray icon.  The message will
 * disappear after a time or if the user clicks on it.  Clicking
 * on the message may trigger an {@code ActionEvent}.
 *
 * <p>Either the caption or the text may be {@code null}, but an
 * {@code NullPointerException} is thrown if both are
 * {@code null}.
 *
 * When displayed, the caption or text strings may be truncated on
 * some platforms; the number of characters that may be displayed is
 * platform-dependent.
 *
 * <p><strong>Note:</strong> Some platforms may not support
 * showing a message.
 *
 * @param caption the caption displayed above the text, usually in
 * bold; may be {@code null}
 * @param text the text displayed for the particular message; may be
 * {@code null}
 * @param messageType an enum indicating the message type
 * @throws NullPointerException if both {@code caption}
 * and {@code text} are {@code null}
 */
public void displayMessage(String caption, String text, MessageType messageType) {
    if (caption == null && text == null) {
        throw new NullPointerException("displaying the message with both caption and text being null");
    }

    TrayIconPeer peer = this.peer;
    if (peer != null) {
        peer.displayMessage(caption, text, messageType.name());
    }
}
 
Example 13
Source File: TrayIcon.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Displays a popup message near the tray icon.  The message will
 * disappear after a time or if the user clicks on it.  Clicking
 * on the message may trigger an {@code ActionEvent}.
 *
 * <p>Either the caption or the text may be <code>null</code>, but an
 * <code>NullPointerException</code> is thrown if both are
 * <code>null</code>.
 *
 * When displayed, the caption or text strings may be truncated on
 * some platforms; the number of characters that may be displayed is
 * platform-dependent.
 *
 * <p><strong>Note:</strong> Some platforms may not support
 * showing a message.
 *
 * @param caption the caption displayed above the text, usually in
 * bold; may be <code>null</code>
 * @param text the text displayed for the particular message; may be
 * <code>null</code>
 * @param messageType an enum indicating the message type
 * @throws NullPointerException if both <code>caption</code>
 * and <code>text</code> are <code>null</code>
 */
public void displayMessage(String caption, String text, MessageType messageType) {
    if (caption == null && text == null) {
        throw new NullPointerException("displaying the message with both caption and text being null");
    }

    TrayIconPeer peer = this.peer;
    if (peer != null) {
        peer.displayMessage(caption, text, messageType.name());
    }
}
 
Example 14
Source File: TrayIcon.java    From openjdk-jdk8u with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Displays a popup message near the tray icon.  The message will
 * disappear after a time or if the user clicks on it.  Clicking
 * on the message may trigger an {@code ActionEvent}.
 *
 * <p>Either the caption or the text may be <code>null</code>, but an
 * <code>NullPointerException</code> is thrown if both are
 * <code>null</code>.
 *
 * When displayed, the caption or text strings may be truncated on
 * some platforms; the number of characters that may be displayed is
 * platform-dependent.
 *
 * <p><strong>Note:</strong> Some platforms may not support
 * showing a message.
 *
 * @param caption the caption displayed above the text, usually in
 * bold; may be <code>null</code>
 * @param text the text displayed for the particular message; may be
 * <code>null</code>
 * @param messageType an enum indicating the message type
 * @throws NullPointerException if both <code>caption</code>
 * and <code>text</code> are <code>null</code>
 */
public void displayMessage(String caption, String text, MessageType messageType) {
    if (caption == null && text == null) {
        throw new NullPointerException("displaying the message with both caption and text being null");
    }

    TrayIconPeer peer = this.peer;
    if (peer != null) {
        peer.displayMessage(caption, text, messageType.name());
    }
}
 
Example 15
Source File: TrayIcon.java    From JDKSourceCode1.8 with MIT License 3 votes vote down vote up
/**
 * Displays a popup message near the tray icon.  The message will
 * disappear after a time or if the user clicks on it.  Clicking
 * on the message may trigger an {@code ActionEvent}.
 *
 * <p>Either the caption or the text may be <code>null</code>, but an
 * <code>NullPointerException</code> is thrown if both are
 * <code>null</code>.
 *
 * When displayed, the caption or text strings may be truncated on
 * some platforms; the number of characters that may be displayed is
 * platform-dependent.
 *
 * <p><strong>Note:</strong> Some platforms may not support
 * showing a message.
 *
 * @param caption the caption displayed above the text, usually in
 * bold; may be <code>null</code>
 * @param text the text displayed for the particular message; may be
 * <code>null</code>
 * @param messageType an enum indicating the message type
 * @throws NullPointerException if both <code>caption</code>
 * and <code>text</code> are <code>null</code>
 */
public void displayMessage(String caption, String text, MessageType messageType) {
    if (caption == null && text == null) {
        throw new NullPointerException("displaying the message with both caption and text being null");
    }

    TrayIconPeer peer = this.peer;
    if (peer != null) {
        peer.displayMessage(caption, text, messageType.name());
    }
}
 
Example 16
Source File: TrayIcon.java    From jdk8u60 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Displays a popup message near the tray icon.  The message will
 * disappear after a time or if the user clicks on it.  Clicking
 * on the message may trigger an {@code ActionEvent}.
 *
 * <p>Either the caption or the text may be <code>null</code>, but an
 * <code>NullPointerException</code> is thrown if both are
 * <code>null</code>.
 *
 * When displayed, the caption or text strings may be truncated on
 * some platforms; the number of characters that may be displayed is
 * platform-dependent.
 *
 * <p><strong>Note:</strong> Some platforms may not support
 * showing a message.
 *
 * @param caption the caption displayed above the text, usually in
 * bold; may be <code>null</code>
 * @param text the text displayed for the particular message; may be
 * <code>null</code>
 * @param messageType an enum indicating the message type
 * @throws NullPointerException if both <code>caption</code>
 * and <code>text</code> are <code>null</code>
 */
public void displayMessage(String caption, String text, MessageType messageType) {
    if (caption == null && text == null) {
        throw new NullPointerException("displaying the message with both caption and text being null");
    }

    TrayIconPeer peer = this.peer;
    if (peer != null) {
        peer.displayMessage(caption, text, messageType.name());
    }
}
 
Example 17
Source File: TrayIcon.java    From TencentKona-8 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Displays a popup message near the tray icon.  The message will
 * disappear after a time or if the user clicks on it.  Clicking
 * on the message may trigger an {@code ActionEvent}.
 *
 * <p>Either the caption or the text may be <code>null</code>, but an
 * <code>NullPointerException</code> is thrown if both are
 * <code>null</code>.
 *
 * When displayed, the caption or text strings may be truncated on
 * some platforms; the number of characters that may be displayed is
 * platform-dependent.
 *
 * <p><strong>Note:</strong> Some platforms may not support
 * showing a message.
 *
 * @param caption the caption displayed above the text, usually in
 * bold; may be <code>null</code>
 * @param text the text displayed for the particular message; may be
 * <code>null</code>
 * @param messageType an enum indicating the message type
 * @throws NullPointerException if both <code>caption</code>
 * and <code>text</code> are <code>null</code>
 */
public void displayMessage(String caption, String text, MessageType messageType) {
    if (caption == null && text == null) {
        throw new NullPointerException("displaying the message with both caption and text being null");
    }

    TrayIconPeer peer = this.peer;
    if (peer != null) {
        peer.displayMessage(caption, text, messageType.name());
    }
}
 
Example 18
Source File: TrayIcon.java    From dragonwell8_jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Displays a popup message near the tray icon.  The message will
 * disappear after a time or if the user clicks on it.  Clicking
 * on the message may trigger an {@code ActionEvent}.
 *
 * <p>Either the caption or the text may be <code>null</code>, but an
 * <code>NullPointerException</code> is thrown if both are
 * <code>null</code>.
 *
 * When displayed, the caption or text strings may be truncated on
 * some platforms; the number of characters that may be displayed is
 * platform-dependent.
 *
 * <p><strong>Note:</strong> Some platforms may not support
 * showing a message.
 *
 * @param caption the caption displayed above the text, usually in
 * bold; may be <code>null</code>
 * @param text the text displayed for the particular message; may be
 * <code>null</code>
 * @param messageType an enum indicating the message type
 * @throws NullPointerException if both <code>caption</code>
 * and <code>text</code> are <code>null</code>
 */
public void displayMessage(String caption, String text, MessageType messageType) {
    if (caption == null && text == null) {
        throw new NullPointerException("displaying the message with both caption and text being null");
    }

    TrayIconPeer peer = this.peer;
    if (peer != null) {
        peer.displayMessage(caption, text, messageType.name());
    }
}