title: How to detect JFrame window minimize and maximize events?
body: <p>Is there a way to an event listener to a JFrame object to detect when the user clicks the window maximize or minimize buttons?</p>
  
  <p>Am using the JFrame object as follows:</p>
  
  <p><code>JFrame frame = new JFrame("Frame");</code></p>