本文整理汇总了Java中java.awt.Component.removeComponentListener方法的典型用法代码示例。如果您正苦于以下问题:Java Component.removeComponentListener方法的具体用法?Java Component.removeComponentListener怎么用?Java Component.removeComponentListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.Component
的用法示例。
在下文中一共展示了Component.removeComponentListener方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: componentResized
import java.awt.Component; //导入方法依赖的package包/类
/**
* May be called for either component or horizontal scrollbar.
*/
public @Override void componentResized(ComponentEvent e) {
Component c = e.getComponent();
if (c == component) { // called for component
// In case the caretBounds are still null
// (component not connected to hierarchy yet or it has zero size
// so the modelToView() returned null) re-attempt to compute the bounds.
CaretItem caret = getLastCaretItem();
if (caret.getCaretBounds() == null) {
dispatchUpdate(false);
resetBlink();
if (caret.getCaretBounds() != null) { // detach the listener - no longer necessary
c.removeComponentListener(this);
}
}
}
}
示例2: componentResized
import java.awt.Component; //导入方法依赖的package包/类
/**
* May be called for either component or horizontal scrollbar.
*/
public @Override void componentResized(ComponentEvent e) {
Component c = e.getComponent();
if (c == component) { // called for component
// In case the caretBounds are still null
// (component not connected to hierarchy yet or it has zero size
// so the modelToView() returned null) re-attempt to compute the bounds.
if (caretBounds == null) {
dispatchUpdate(true);
if (caretBounds != null) { // detach the listener - no longer necessary
c.removeComponentListener(this);
}
}
}
}
示例3: unregisterListeners
import java.awt.Component; //导入方法依赖的package包/类
private void unregisterListeners(Component component) {
if (splitPaneComponentListener != null) {
component.removeComponentListener(splitPaneComponentListener);
}
if (splitPaneActionListener != null) {
if (component instanceof JTitledPanel) {
((JTitledPanel) component).removeActionListener(splitPaneActionListener);
}
//else if (component instanceof JExtendedSplitPane) ((JTitledPanel)component).removeActionListener(splitPaneActionListener);
}
}
示例4: removeListeners
import java.awt.Component; //导入方法依赖的package包/类
void removeListeners(Component ancestor) {
Component a;
for (a = ancestor; a != null; a = a.getParent()) {
a.removeComponentListener(this);
if (a instanceof JComponent) {
JComponent jAncestor = (JComponent)a;
jAncestor.removePropertyChangeListener(this);
}
if (a == firstInvisibleAncestor || a instanceof Window) {
break;
}
}
}
示例5: onDispose
import java.awt.Component; //导入方法依赖的package包/类
@Override
protected void onDispose(Component w) {
w.removeComponentListener(this);
}