title: Capturing the close tab event of a JTabbedPanel in Java Swing
body: <p>Is it possible to capture the close tab event for a JTabbedPanel in Java Swing.</p>
  
  <p>I want to check for some conditions and if they are not met, then I have to prevent the user from closing it.</p>
  
  <p>Thanks!</p>
  
  <p>Update: I created a custom event, based on this <a href="http://www.exampledepot.com/egs/java.util/CustEvent.html" rel="nofollow noreferrer">code</a> and it solved my problem.</p>