本文整理匯總了Java中javax.swing.JComponent.removeMouseListener方法的典型用法代碼示例。如果您正苦於以下問題:Java JComponent.removeMouseListener方法的具體用法?Java JComponent.removeMouseListener怎麽用?Java JComponent.removeMouseListener使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.swing.JComponent
的用法示例。
在下文中一共展示了JComponent.removeMouseListener方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: registerComponent
import javax.swing.JComponent; //導入方法依賴的package包/類
/**
* 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
}
}
}
示例2: unregisterComponent
import javax.swing.JComponent; //導入方法依賴的package包/類
/**
* 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
}
}
}
示例3: removeItem
import javax.swing.JComponent; //導入方法依賴的package包/類
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);
}
}
示例4: uninstallUI
import javax.swing.JComponent; //導入方法依賴的package包/類
@Override
public void uninstallUI(JComponent c)
{
super.uninstallUI(c);
c.removeMouseListener(this);
}
示例5: uninstallFromComponent
import javax.swing.JComponent; //導入方法依賴的package包/類
public static void uninstallFromComponent(JComponent c) {
if (c instanceof JTextField && !(c instanceof JPasswordField)) {
c.removeMouseListener(getSharedInstance());
}
}