本文整理汇总了Java中java.awt.event.ComponentEvent.getID方法的典型用法代码示例。如果您正苦于以下问题:Java ComponentEvent.getID方法的具体用法?Java ComponentEvent.getID怎么用?Java ComponentEvent.getID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.event.ComponentEvent
的用法示例。
在下文中一共展示了ComponentEvent.getID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processComponentEvent
import java.awt.event.ComponentEvent; //导入方法依赖的package包/类
/**
* Overridden so we can tell when the text area is resized and update the
* current-line highlight, if necessary (i.e., if it is enabled and if
* lineWrap is enabled.
*
* @param e The component event about to be sent to all registered
* <code>ComponentListener</code>s.
*/
@Override
protected void processComponentEvent(ComponentEvent e) {
// In line wrap mode, resizing the text area means that the caret's
// "line" could change - not to a different logical line, but a
// different physical one. So, here we force a repaint of the current
// line's highlight if necessary.
if (e.getID()==ComponentEvent.COMPONENT_RESIZED &&
getLineWrap() && getHighlightCurrentLine()) {
previousCaretY = -1; // So we are sure to repaint.
fireCaretUpdate(mouseListener);
}
super.processComponentEvent(e);
}