本文整理汇总了Java中java.awt.event.FocusListener.focusGained方法的典型用法代码示例。如果您正苦于以下问题:Java FocusListener.focusGained方法的具体用法?Java FocusListener.focusGained怎么用?Java FocusListener.focusGained使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.event.FocusListener
的用法示例。
在下文中一共展示了FocusListener.focusGained方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: focusGained
import java.awt.event.FocusListener; //导入方法依赖的package包/类
/** Delegates to the original listener.
*/
public void focusGained(FocusEvent ev) {
FocusListener l = (FocusListener) super.get(ev);
if (l != null) {
l.focusGained(ev);
}
}
示例2: focusGained
import java.awt.event.FocusListener; //导入方法依赖的package包/类
/** Delegates to the original listener.
*/
@Override public void focusGained(FocusEvent ev) {
FocusListener l = (FocusListener) super.get(ev);
if (l != null) {
l.focusGained(ev);
}
}
示例3: focusGained
import java.awt.event.FocusListener; //导入方法依赖的package包/类
@Override
public void focusGained(FocusEvent evt) {
focusCatched = evt.getOppositeComponent()==target;//On a récupéré le focus directement depuis la cible
boolean alreadyFocused = focusCatched || focused;
focusCatched = true;focused=true;
if(!canDispatch(evt) || alreadyFocused) {return;}
FocusEvent e = new FocusEvent(evt.getComponent(), evt.getID(), evt.isTemporary(), evt.getOppositeComponent());
FocusListener[] listeners = getListenersAndAdaptEvent(e, FocusListener.class);
for(FocusListener l : listeners) {l.focusGained(e);}
}
示例4: processFocusEventImpl
import java.awt.event.FocusListener; //导入方法依赖的package包/类
private void processFocusEventImpl(FocusEvent e, Collection<FocusListener> c) {
for (FocusListener listener : c) {
switch (e.getID()) {
case FocusEvent.FOCUS_GAINED:
listener.focusGained(e);
break;
case FocusEvent.FOCUS_LOST:
listener.focusLost(e);
break;
}
}
}
示例5: testToolBarFocusListener
import java.awt.event.FocusListener; //导入方法依赖的package包/类
public void testToolBarFocusListener() {
toolBar.add(b);
FocusListener l = ui.createToolBarFocusListener();
FocusEvent e = new FocusEvent(b, FocusEvent.FOCUS_GAINED);
l.focusGained(e);
assertEquals(toolBar.getComponentIndex(b), ui.focusedCompIndex);
}
示例6: focusGained
import java.awt.event.FocusListener; //导入方法依赖的package包/类
@Override
public void focusGained(FocusEvent e) {
for (FocusListener listener : myFocusListeners) {
listener.focusGained(e);
}
}
示例7: focusGained
import java.awt.event.FocusListener; //导入方法依赖的package包/类
/** Delegates to the original listener.
*/
public void focusGained(FocusEvent ev) {
FocusListener l = (FocusListener)super.get (ev);
if (l != null) l.focusGained (ev);
}