title: Swing: Show/hide button on mouse over
body: <p>So I want to put a button in a <code>JPanel</code>, but I want to keep it invisible/hidden unless the mouse pointer hovers over it. At this point, the button should be made visible, react to clicks and so on. When the mouse leaves the area, it should be hidden again.</p>
  
  <p>I tried adding a <code>MouseListener</code> to my <code>JButton</code> and use <code>setVisible()</code>, but when I hide the button (<code>setVisible(false)</code>), then the listener doesn't work anymore - the application behaves as if the button is not there at all.</p>
  
  <p>What's the correct way to implement this behavior?</p>
  
  <p>Edit: I am using an absolute layout (<code>setLayout(null)</code>) and I am manually placing my component using <code>setBounds(x, y, width, height)</code>.</p>