title: Making Image button look pressed/clicked in Swing
body: <p>I created a JButton which has an image set as an icon representing the button. Now, I've set </p>
  
  <pre><code>setContentAreaFilled(false);
  setBorderPainted(false);
  setOpaque(false);
  </code></pre>
  
  <p>the properties which this makes an image-button look nice with no borders or background colors etc.</p>
  
  <p>Now the problem is that when I click on the image, it shows no onclick effects of a button, so when there is some background processing involved or some event is bring fired on click of button which takes time to process the request and return something, it gives an impression that the button was not clicked and the user might keep clicking it.</p>
  
  <p>How do I make a button which has an icon set with the above mentioned properties and yet I have some control over setting the onpress or onmouseover events.</p>