title: Java Exceptions - Handling exceptions without try catch
body: <p>In Java, we handle exceptions using try catch blocks. I know that I can write a try catch block like the one below to catch any exception thrown in a method.</p>
  
  <pre><code>try {
    // do something
  }
  catch (Throwable t) {
  
  }
  </code></pre>
  
  <p>But is there any way in Java which allows me to get a specific method called when an exception happens, instead of writing a catch-all method like the one above?</p>
  
  <p>Specifically, I would like to show a user friendly message in my Swing application when an exception is thrown (which is not handled by my application logic).</p>
  
  <p>Thanks.</p>