Java Code Examples for javax.swing.JComponent.removeMouseListener()

The following are Jave code examples for showing how to use removeMouseListener() of the javax.swing.JComponent class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: incubator-netbeans   File: ToolTipManagerEx.java   View Source Code Vote up 6 votes
/**
    * Registers a component for tooltip management.
    * <p>
    * This will register key bindings to show and hide the tooltip text
    * only if <code>component</code> has focus bindings. This is done
    * so that components that are not normally focus traversable, such
    * as <code>JLabel</code>, are not made focus traversable as a result
    * of invoking this method.
    *
    * @param component  a <code>JComponent</code> object to add
    * @see JComponent#isFocusTraversable
    */
   protected void registerComponent(JComponent component) {
       component.removeMouseListener(this);
       component.addMouseListener(this);
       component.removeMouseMotionListener(moveBeforeEnterListener);
component.addMouseMotionListener(moveBeforeEnterListener);

if (shouldRegisterBindings(component)) {
    // register our accessibility keybindings for this component
    // this will apply globally across L&F
    // Post Tip: Ctrl+F1
    // Unpost Tip: Esc and Ctrl+F1
    InputMap inputMap = component.getInputMap(JComponent.WHEN_FOCUSED);
    ActionMap actionMap = component.getActionMap();

    if (inputMap != null && actionMap != null) {
               //XXX remove
    }
}
   }
 
Example 2
Project: incubator-netbeans   File: ToolTipManagerEx.java   View Source Code Vote up 5 votes
/**
    * Removes a component from tooltip control.
    *
    * @param component  a <code>JComponent</code> object to remove
    */
   protected void unregisterComponent(JComponent component) {
       component.removeMouseListener(this);
component.removeMouseMotionListener(moveBeforeEnterListener);

if (shouldRegisterBindings(component)) {
    InputMap inputMap = component.getInputMap(JComponent.WHEN_FOCUSED);
    ActionMap actionMap = component.getActionMap();

    if (inputMap != null && actionMap != null) {
               //XXX remove
    }
}
   }
 
Example 3
Project: incubator-netbeans   File: TransparentToolBar.java   View Source Code Vote up 5 votes
public void removeItem(JComponent c) {
    if (toolbar != null) {
        toolbar.remove(c);
    } else {
        if (c instanceof AbstractButton) {
            c.removeMouseListener(listener);
            ((AbstractButton) c).removeChangeListener(listener);
            c.removeFocusListener(listener);
        }
        remove(c);
    }
}
 
Example 4
Project: Equella   File: FlatterCheckBoxUI.java   View Source Code Vote up 4 votes
@Override
public void uninstallUI(JComponent c)
{
	super.uninstallUI(c);
	c.removeMouseListener(this);
}
 
Example 5
Project: FinalSpeed   File: TextComponentPopupMenu.java   View Source Code Vote up 4 votes
public static void uninstallFromComponent(JComponent c) {
	if (c instanceof JTextField && !(c instanceof JPasswordField)) {
		c.removeMouseListener(getSharedInstance());
	}
}