Java Code Examples for java.awt.Toolkit#beep()

The following examples show how to use java.awt.Toolkit#beep() . 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: MacEditorKit.java    From seaglass with Apache License 2.0 5 votes vote down vote up
/**
 * Invoked when the user attempts an invalid operation, such as pasting into
 * an uneditable <code>JTextField</code> that has focus. The default
 * implementation beeps. Subclasses that wish different behavior should
 * override this and provide the additional feedback.
 *
 * @param component Component the error occured in, may be null indicating
 *                  the error condition is not directly associated with a
 *                  <code>Component</code>.
 */
static void provideErrorFeedback(Component component) {
    Toolkit toolkit = null;

    if (component != null) {
        toolkit = component.getToolkit();
    } else {
        toolkit = Toolkit.getDefaultToolkit();
    }

    toolkit.beep();
}
 
Example 2
Source File: LookAndFeel.java    From jdk8u-jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Invoked when the user attempts an invalid operation,
 * such as pasting into an uneditable <code>JTextField</code>
 * that has focus. The default implementation beeps. Subclasses
 * that wish different behavior should override this and provide
 * the additional feedback.
 *
 * @param component the <code>Component</code> the error occurred in,
 *                  may be <code>null</code>
 *                  indicating the error condition is not directly
 *                  associated with a <code>Component</code>
 * @since 1.4
 */
public void provideErrorFeedback(Component component) {
    Toolkit toolkit = null;
    if (component != null) {
        toolkit = component.getToolkit();
    } else {
        toolkit = Toolkit.getDefaultToolkit();
    }
    toolkit.beep();
}
 
Example 3
Source File: LookAndFeel.java    From jdk8u-dev-jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Invoked when the user attempts an invalid operation,
 * such as pasting into an uneditable <code>JTextField</code>
 * that has focus. The default implementation beeps. Subclasses
 * that wish different behavior should override this and provide
 * the additional feedback.
 *
 * @param component the <code>Component</code> the error occurred in,
 *                  may be <code>null</code>
 *                  indicating the error condition is not directly
 *                  associated with a <code>Component</code>
 * @since 1.4
 */
public void provideErrorFeedback(Component component) {
    Toolkit toolkit = null;
    if (component != null) {
        toolkit = component.getToolkit();
    } else {
        toolkit = Toolkit.getDefaultToolkit();
    }
    toolkit.beep();
}
 
Example 4
Source File: LookAndFeel.java    From jdk8u-jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Invoked when the user attempts an invalid operation,
 * such as pasting into an uneditable <code>JTextField</code>
 * that has focus. The default implementation beeps. Subclasses
 * that wish different behavior should override this and provide
 * the additional feedback.
 *
 * @param component the <code>Component</code> the error occurred in,
 *                  may be <code>null</code>
 *                  indicating the error condition is not directly
 *                  associated with a <code>Component</code>
 * @since 1.4
 */
public void provideErrorFeedback(Component component) {
    Toolkit toolkit = null;
    if (component != null) {
        toolkit = component.getToolkit();
    } else {
        toolkit = Toolkit.getDefaultToolkit();
    }
    toolkit.beep();
}
 
Example 5
Source File: LookAndFeel.java    From jdk8u_jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Invoked when the user attempts an invalid operation,
 * such as pasting into an uneditable <code>JTextField</code>
 * that has focus. The default implementation beeps. Subclasses
 * that wish different behavior should override this and provide
 * the additional feedback.
 *
 * @param component the <code>Component</code> the error occurred in,
 *                  may be <code>null</code>
 *                  indicating the error condition is not directly
 *                  associated with a <code>Component</code>
 * @since 1.4
 */
public void provideErrorFeedback(Component component) {
    Toolkit toolkit = null;
    if (component != null) {
        toolkit = component.getToolkit();
    } else {
        toolkit = Toolkit.getDefaultToolkit();
    }
    toolkit.beep();
}
 
Example 6
Source File: LookAndFeel.java    From openjdk-8 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Invoked when the user attempts an invalid operation,
 * such as pasting into an uneditable <code>JTextField</code>
 * that has focus. The default implementation beeps. Subclasses
 * that wish different behavior should override this and provide
 * the additional feedback.
 *
 * @param component the <code>Component</code> the error occurred in,
 *                  may be <code>null</code>
 *                  indicating the error condition is not directly
 *                  associated with a <code>Component</code>
 * @since 1.4
 */
public void provideErrorFeedback(Component component) {
    Toolkit toolkit = null;
    if (component != null) {
        toolkit = component.getToolkit();
    } else {
        toolkit = Toolkit.getDefaultToolkit();
    }
    toolkit.beep();
}
 
Example 7
Source File: LookAndFeel.java    From openjdk-8-source with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Invoked when the user attempts an invalid operation,
 * such as pasting into an uneditable <code>JTextField</code>
 * that has focus. The default implementation beeps. Subclasses
 * that wish different behavior should override this and provide
 * the additional feedback.
 *
 * @param component the <code>Component</code> the error occurred in,
 *                  may be <code>null</code>
 *                  indicating the error condition is not directly
 *                  associated with a <code>Component</code>
 * @since 1.4
 */
public void provideErrorFeedback(Component component) {
    Toolkit toolkit = null;
    if (component != null) {
        toolkit = component.getToolkit();
    } else {
        toolkit = Toolkit.getDefaultToolkit();
    }
    toolkit.beep();
}
 
Example 8
Source File: LookAndFeel.java    From hottub with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Invoked when the user attempts an invalid operation,
 * such as pasting into an uneditable <code>JTextField</code>
 * that has focus. The default implementation beeps. Subclasses
 * that wish different behavior should override this and provide
 * the additional feedback.
 *
 * @param component the <code>Component</code> the error occurred in,
 *                  may be <code>null</code>
 *                  indicating the error condition is not directly
 *                  associated with a <code>Component</code>
 * @since 1.4
 */
public void provideErrorFeedback(Component component) {
    Toolkit toolkit = null;
    if (component != null) {
        toolkit = component.getToolkit();
    } else {
        toolkit = Toolkit.getDefaultToolkit();
    }
    toolkit.beep();
}
 
Example 9
Source File: LookAndFeel.java    From Java8CN with Apache License 2.0 3 votes vote down vote up
/**
 * Invoked when the user attempts an invalid operation,
 * such as pasting into an uneditable <code>JTextField</code>
 * that has focus. The default implementation beeps. Subclasses
 * that wish different behavior should override this and provide
 * the additional feedback.
 *
 * @param component the <code>Component</code> the error occurred in,
 *                  may be <code>null</code>
 *                  indicating the error condition is not directly
 *                  associated with a <code>Component</code>
 * @since 1.4
 */
public void provideErrorFeedback(Component component) {
    Toolkit toolkit = null;
    if (component != null) {
        toolkit = component.getToolkit();
    } else {
        toolkit = Toolkit.getDefaultToolkit();
    }
    toolkit.beep();
}
 
Example 10
Source File: LookAndFeel.java    From jdk1.8-source-analysis with Apache License 2.0 3 votes vote down vote up
/**
 * Invoked when the user attempts an invalid operation,
 * such as pasting into an uneditable <code>JTextField</code>
 * that has focus. The default implementation beeps. Subclasses
 * that wish different behavior should override this and provide
 * the additional feedback.
 *
 * @param component the <code>Component</code> the error occurred in,
 *                  may be <code>null</code>
 *                  indicating the error condition is not directly
 *                  associated with a <code>Component</code>
 * @since 1.4
 */
public void provideErrorFeedback(Component component) {
    Toolkit toolkit = null;
    if (component != null) {
        toolkit = component.getToolkit();
    } else {
        toolkit = Toolkit.getDefaultToolkit();
    }
    toolkit.beep();
}
 
Example 11
Source File: LookAndFeel.java    From openjdk-jdk9 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Invoked when the user attempts an invalid operation,
 * such as pasting into an uneditable <code>JTextField</code>
 * that has focus. The default implementation beeps. Subclasses
 * that wish different behavior should override this and provide
 * the additional feedback.
 *
 * @param component the <code>Component</code> the error occurred in,
 *                  may be <code>null</code>
 *                  indicating the error condition is not directly
 *                  associated with a <code>Component</code>
 * @since 1.4
 */
public void provideErrorFeedback(Component component) {
    Toolkit toolkit = null;
    if (component != null) {
        toolkit = component.getToolkit();
    } else {
        toolkit = Toolkit.getDefaultToolkit();
    }
    toolkit.beep();
}
 
Example 12
Source File: LookAndFeel.java    From Bytecoder with Apache License 2.0 3 votes vote down vote up
/**
 * Invoked when the user attempts an invalid operation,
 * such as pasting into an uneditable <code>JTextField</code>
 * that has focus. The default implementation beeps. Subclasses
 * that wish different behavior should override this and provide
 * the additional feedback.
 *
 * @param component the <code>Component</code> the error occurred in,
 *                  may be <code>null</code>
 *                  indicating the error condition is not directly
 *                  associated with a <code>Component</code>
 * @since 1.4
 */
public void provideErrorFeedback(Component component) {
    Toolkit toolkit = null;
    if (component != null) {
        toolkit = component.getToolkit();
    } else {
        toolkit = Toolkit.getDefaultToolkit();
    }
    toolkit.beep();
}
 
Example 13
Source File: LookAndFeel.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Invoked when the user attempts an invalid operation,
 * such as pasting into an uneditable <code>JTextField</code>
 * that has focus. The default implementation beeps. Subclasses
 * that wish different behavior should override this and provide
 * the additional feedback.
 *
 * @param component the <code>Component</code> the error occurred in,
 *                  may be <code>null</code>
 *                  indicating the error condition is not directly
 *                  associated with a <code>Component</code>
 * @since 1.4
 */
public void provideErrorFeedback(Component component) {
    Toolkit toolkit = null;
    if (component != null) {
        toolkit = component.getToolkit();
    } else {
        toolkit = Toolkit.getDefaultToolkit();
    }
    toolkit.beep();
}
 
Example 14
Source File: LookAndFeel.java    From openjdk-jdk8u with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Invoked when the user attempts an invalid operation,
 * such as pasting into an uneditable <code>JTextField</code>
 * that has focus. The default implementation beeps. Subclasses
 * that wish different behavior should override this and provide
 * the additional feedback.
 *
 * @param component the <code>Component</code> the error occurred in,
 *                  may be <code>null</code>
 *                  indicating the error condition is not directly
 *                  associated with a <code>Component</code>
 * @since 1.4
 */
public void provideErrorFeedback(Component component) {
    Toolkit toolkit = null;
    if (component != null) {
        toolkit = component.getToolkit();
    } else {
        toolkit = Toolkit.getDefaultToolkit();
    }
    toolkit.beep();
}
 
Example 15
Source File: LookAndFeel.java    From JDKSourceCode1.8 with MIT License 3 votes vote down vote up
/**
 * Invoked when the user attempts an invalid operation,
 * such as pasting into an uneditable <code>JTextField</code>
 * that has focus. The default implementation beeps. Subclasses
 * that wish different behavior should override this and provide
 * the additional feedback.
 *
 * @param component the <code>Component</code> the error occurred in,
 *                  may be <code>null</code>
 *                  indicating the error condition is not directly
 *                  associated with a <code>Component</code>
 * @since 1.4
 */
public void provideErrorFeedback(Component component) {
    Toolkit toolkit = null;
    if (component != null) {
        toolkit = component.getToolkit();
    } else {
        toolkit = Toolkit.getDefaultToolkit();
    }
    toolkit.beep();
}
 
Example 16
Source File: LookAndFeel.java    From jdk8u60 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Invoked when the user attempts an invalid operation,
 * such as pasting into an uneditable <code>JTextField</code>
 * that has focus. The default implementation beeps. Subclasses
 * that wish different behavior should override this and provide
 * the additional feedback.
 *
 * @param component the <code>Component</code> the error occurred in,
 *                  may be <code>null</code>
 *                  indicating the error condition is not directly
 *                  associated with a <code>Component</code>
 * @since 1.4
 */
public void provideErrorFeedback(Component component) {
    Toolkit toolkit = null;
    if (component != null) {
        toolkit = component.getToolkit();
    } else {
        toolkit = Toolkit.getDefaultToolkit();
    }
    toolkit.beep();
}
 
Example 17
Source File: LookAndFeel.java    From TencentKona-8 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Invoked when the user attempts an invalid operation,
 * such as pasting into an uneditable <code>JTextField</code>
 * that has focus. The default implementation beeps. Subclasses
 * that wish different behavior should override this and provide
 * the additional feedback.
 *
 * @param component the <code>Component</code> the error occurred in,
 *                  may be <code>null</code>
 *                  indicating the error condition is not directly
 *                  associated with a <code>Component</code>
 * @since 1.4
 */
public void provideErrorFeedback(Component component) {
    Toolkit toolkit = null;
    if (component != null) {
        toolkit = component.getToolkit();
    } else {
        toolkit = Toolkit.getDefaultToolkit();
    }
    toolkit.beep();
}
 
Example 18
Source File: LookAndFeel.java    From dragonwell8_jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Invoked when the user attempts an invalid operation,
 * such as pasting into an uneditable <code>JTextField</code>
 * that has focus. The default implementation beeps. Subclasses
 * that wish different behavior should override this and provide
 * the additional feedback.
 *
 * @param component the <code>Component</code> the error occurred in,
 *                  may be <code>null</code>
 *                  indicating the error condition is not directly
 *                  associated with a <code>Component</code>
 * @since 1.4
 */
public void provideErrorFeedback(Component component) {
    Toolkit toolkit = null;
    if (component != null) {
        toolkit = component.getToolkit();
    } else {
        toolkit = Toolkit.getDefaultToolkit();
    }
    toolkit.beep();
}