@Override
    public void stateChanged(ChangeEvent e) {
      if (ApplicationManager.getApplication().isDispatchThread()) {
        updateModel();
      }
      else {
        ApplicationManager.getApplication().invokeLater(() -> updateModel());
      }
    }
@Override
    public void stateChanged(ChangeEvent e)