void () { boolean needRepaint = false; if (myFeedbackPainterPanel.getParent() == this) { remove(myFeedbackPainterPanel); needRepaint = true; } if (myToolTip.getParent() == this) { remove(myToolTip); needRepaint = true; } if (needRepaint) repaint(); }