Exemplo n.º 1
0
  // Define a getMessage() method.
  private void getMessage(JTextAreaPanel in) {
    // Try to get incoming message.
    try {
      // Receive message text.
      in.getMessage();

    } // End of try to get message.
    catch (BufferEmptyException e) // Catch BufferEmptyException.
    {
      // Capture the stack trace into a String.
      setExceptionString(e.fillInStackTrace());

      // Pass message to the JOptionPane manager.
      setExceptionPane(
          "There is nothing in the buffer to receive.\n\n" + "Do you want to see the stack trace?");
    } // End of catch on BufferEmptyException.
  } // End of getMessage() method.