for( JButton currentButton: button ) { for( ActionListener al : currentButton.getActionListeners() ) { currentButton.removeActionListener( al ); } }
public void cleanUp() { for (ActionListener al : btnGenerate.getActionListeners()) { btnGenerate.removeActionListener(al); } for (ActionListener al : btnCancel.getActionListeners()) { btnCancel.removeActionListener(al); } for (ActionListener al : btnReset.getActionListeners()) { btnReset.removeActionListener(al); } for (ItemListener il : cAdvanced.getItemListeners()) { cAdvanced.removeItemListener(il); } }
public void CleanUp() { battlefieldPanel.cleanUp(); playerPanel.cleanUp(); for (ActionListener al : btnCheat.getActionListeners()) { btnCheat.removeActionListener(al); } // Taken form : https://community.oracle.com/thread/2183145 // removed the internal focus of a popupMenu data to allow GC before another popup menu is selected for (ChangeListener listener : MenuSelectionManager.defaultManager().getChangeListeners()) { if (listener.getClass().getName().contains("MenuKeyboardHelper")) { try { Field field = listener.getClass().getDeclaredField("menuInputMap"); field.setAccessible(true); field.set(listener, null); } catch (Exception e) { // ignored } break; } } for (MouseListener ml : battlefieldPanel.getMainPanel().getMouseListeners()) { battlefieldPanel.getMainPanel().removeMouseListener(ml); } popupMenu.getUI().uninstallUI(this); }
public void cleanUp() { if (dayNightButton != null) { for (ActionListener al : dayNightButton.getActionListeners()) { dayNightButton.removeActionListener(al); } } for (MouseListener ml : this.getMouseListeners()) { this.removeMouseListener(ml); } for (MouseMotionListener ml : this.getMouseMotionListeners()) { this.removeMouseMotionListener(ml); } for (MouseWheelListener ml : this.getMouseWheelListeners()) { this.removeMouseWheelListener(ml); } // this holds reference to ActionCallback forever so set it to null to prevent this.callback = null; this.data = null; }
/** * This is used to remove an action listener from the ok button. * * @param a The action listener */ public void removeOkListener(ActionListener a) { m_okBut.removeActionListener(a); }
/** * This is used to remove an action listener from the cancel button. * * @param a The action listener */ public void removeCancelListener(ActionListener a) { m_cancelBut.removeActionListener(a); }
@Override public void componentHidden(ComponentEvent e) { //remove the action listener closeButton.removeActionListener(closeAction); exitIfFatal(); } });
/** * Suppression d'un listener aux boutons action du dialog (OK, ANNULER, APPLIQUER). * @see #addActionListener(ActionListener) */ public void removeActionListener(ActionListener _listener) { OK_BUTTON.removeActionListener(_listener); CANCEL_BUTTON.removeActionListener(_listener); APPLY_BUTTON.removeActionListener(_listener); } /**
@Override public void componentHidden(ComponentEvent e) { //remove the action listener closeButton.removeActionListener(closeAction); exitIfFatal(); } });
/** * * @param listener */ public void removeCloseActionListener(ActionListener listener){ myCloseButton.removeActionListener(listener); }
this.btnPlay.removeActionListener(al); this.btnStopReplay.removeActionListener(al); this.btnNextPlay.removeActionListener(al); this.btnNextPlay.removeActionListener(al); this.btnPreviousPlay.removeActionListener(al); this.btnSkipForward.removeActionListener(al); final JButton upArrowButton = (JButton) divider.getComponent(0); for (ActionListener al : upArrowButton.getActionListeners()) { upArrowButton.removeActionListener(al); downArrowButton.removeActionListener(al);
@Override public void windowClosing(WindowEvent e) { //remove the action listener closeButton.removeActionListener(closeAction); detailButton.removeActionListener(resizeListener); exitIfFatal(); } });
@Override public void removeActionListener(final ActionListener l) { super.removeActionListener(l); updateEnabled(); }
public void actionPerformed(ActionEvent e) { cp.add(BorderLayout.SOUTH, moreOrLessPanel); pack(); moreOrLessButton.setText("Fewer Choices"); moreOrLessButton.removeActionListener(more); moreOrLessButton.addActionListener(less); } };
@Override public void windowClosing(WindowEvent e) { //remove the action listener closeButton.removeActionListener(closeAction); detailButton.removeActionListener(resizeListener); exitIfFatal(); } });
public void run() { downloadsLabel.setText(NbBundle.getMessage(kenaiProjectTopComponent.class, "kenaiProjectTopComponent.downloadsLabel.text")); //NOI18N downloadsLabel.setIcon(null); downloadsLabel.setToolTipText(""); //NOI18N downloadsLabel.setCursor(Cursor.getDefaultCursor()); downloadsLabel.removeActionListener(downloadsActionListener); } });
public void removeBar(String name) { bars.get(name).getButton().removeActionListener(buttonsActionListener); bars.remove(name); render(); }
public void DESTROY () { searcher.deregister(this); tree = null; searcher = null; textField.removeActionListener(this); button.removeActionListener(this); textField = null; button = null; }
public void run() { wwwLabel.setText(String.format("<html><a href=\"blank\">%s</a></html>", KENAI_URL + proj.getWebLocation().getPath())); //NOI18N wwwLabel.setIcon(ImageUtilities.loadImageIcon("/org/netbeans/modules/kenai/ui/resources/insertlink.png", false)); //NOI18N wwwLabel.setToolTipText(KENAI_URL + proj.getWebLocation().getPath()); wwwLabel.setCursor(new Cursor(Cursor.HAND_CURSOR)); wwwLabel.removeActionListener(wwwActionListener); wwwActionListener = new URLListener(proj.getWebLocation()); wwwLabel.addActionListener(wwwActionListener); } });
private void configureListeners() { if (isNativeSearchField()) { popupButton().removeActionListener(getHandler()); searchField.removePropertyChangeListener(getHandler()); } else { popupButton().addActionListener(getHandler()); searchField.addPropertyChangeListener(getHandler()); } // add support for instant search mode in any case. searchField.getDocument().addDocumentListener(getHandler()); }