Fix for Issue #19

First commit is a testcase, the second one the fix. Just wrote a simple wrapper for the setVisible() which hides the popup when the panel is about the hide.