本文整理汇总了Java中java.awt.KeyboardFocusManager.setCurrentKeyboardFocusManager方法的典型用法代码示例。如果您正苦于以下问题:Java KeyboardFocusManager.setCurrentKeyboardFocusManager方法的具体用法?Java KeyboardFocusManager.setCurrentKeyboardFocusManager怎么用?Java KeyboardFocusManager.setCurrentKeyboardFocusManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.KeyboardFocusManager
的用法示例。
在下文中一共展示了KeyboardFocusManager.setCurrentKeyboardFocusManager方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: test1
import java.awt.KeyboardFocusManager; //导入方法依赖的package包/类
void test1(final TestCase t) {
Runnable action = new Runnable() {
public void run() {
KeyboardFocusManager.setCurrentKeyboardFocusManager(new TestKFM());
if (t == TestCase.REMOVAL) {
frame.remove(frame.panel0);
} else if (t == TestCase.HIDING) {
frame.panel0.setVisible(false);
}
frame.repaint();
}
};
if (!Util.trackFocusGained(frame.b3, action, 2000, false)) {
throw new TestFailedException(t + ": focus wasn't transfered as expected!");
}
KeyboardFocusManager.setCurrentKeyboardFocusManager(kfm);
}
示例2: Def
import java.awt.KeyboardFocusManager; //导入方法依赖的package包/类
public Def() {
KeyboardFocusManager.setCurrentKeyboardFocusManager(this);
}
示例3: Def
import java.awt.KeyboardFocusManager; //导入方法依赖的package包/类
public Def() {
this.c = c;
KeyboardFocusManager.setCurrentKeyboardFocusManager(this);
}