@Override
  public void installUI(JComponent c) {
    super.installUI(c);

    bar = (JButtonBar) c;

    installDefaults();
    installListeners();

    updateLayout();
  }
 @Override
 public void uninstallUI(JComponent c) {
   uninstallDefaults();
   uninstallListeners();
   super.uninstallUI(c);
 }