private void toggleVisibility(ComponentEvent e) {
        Component component = e.getComponent();
        if (component != null) {
          owner.setVisible(component.isVisible());
        }
      }
private void toggleVisibility(ComponentEvent e)