@Override public void setVisible(boolean visible) { if (!visible && containsFocus()) { clearFocus(); } super.setVisible(visible); }
@Override protected void setParent(Container parent) { // If this container is being removed from the component hierarchy // and contains the focused component, clear the focus if (parent == null && containsFocus()) { clearFocus(); } super.setParent(parent); }
@Override protected void setParent(Container parent) { // If this container is being removed from the component hierarchy // and contains the focused component, clear the focus if (parent == null && containsFocus()) { clearFocus(); } super.setParent(parent); }
@Override public void setVisible(boolean visible) { if (!visible && containsFocus()) { clearFocus(); } super.setVisible(visible); }