Exemple #1
0
 /**
  * Overrides <code>JComponent.removeNotify</code> to check if this button is currently set as the
  * default button on the <code>RootPane</code>, and if so, sets the <code>RootPane</code>'s
  * default button to <code>null</code> to ensure the <code>RootPane</code> doesn't hold onto an
  * invalid button reference.
  */
 public void removeNotify() {
   JRootPane root = SwingUtilities.getRootPane(this);
   if (root != null && root.getDefaultButton() == this) {
     root.setDefaultButton(null);
   }
   super.removeNotify();
 }