本文整理匯總了Java中java.awt.Toolkit.beep方法的典型用法代碼示例。如果您正苦於以下問題:Java Toolkit.beep方法的具體用法?Java Toolkit.beep怎麽用?Java Toolkit.beep使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.awt.Toolkit
的用法示例。
在下文中一共展示了Toolkit.beep方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: beep
import java.awt.Toolkit; //導入方法依賴的package包/類
public static void beep()
{
Toolkit t = Toolkit.getDefaultToolkit();
t.beep();
}
示例2: signalError
import java.awt.Toolkit; //導入方法依賴的package包/類
/**
* Deal with the user clicking on something other than a button or a card.
*/
private void signalError() {
Toolkit t = panel.getToolkit();
t.beep();
}
示例3: provideErrorFeedback
import java.awt.Toolkit; //導入方法依賴的package包/類
/**
* 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();
}