code: static void provideErrorFeedback(Component component) {
          Toolkit toolkit = null;
  
          if (component != null) {
              toolkit = component.getToolkit();
          } else {
              toolkit = Toolkit.getDefaultToolkit();
          }
  
          toolkit.beep();
      }
docs: 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>.