void () { if (myActive != null) { final PaintLocker locker = new PaintLocker(this); try { setPreferredSize(getSize());// froze [this] size remove(myActive.getPanel()); myActive = null; } finally { locker.release(); } } }