本文整理了Java中javax.swing.plaf.basic.BasicButtonListener.focusGained()
方法的一些代码示例,展示了BasicButtonListener.focusGained()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BasicButtonListener.focusGained()
方法的具体详情如下:
包路径:javax.swing.plaf.basic.BasicButtonListener
类名称:BasicButtonListener
方法名:focusGained
暂无
代码示例来源:origin: org.java.net.substance/substance
@Override
public void focusGained(FocusEvent e) {
this.stateTransitionTracker.turnOffModelChangeTracking();
try {
super.focusGained(e);
if (!this.button.isShowing()) {
// shouldn't happen. Is some lurking Swing bug
return;
}
try {
PointerInfo pi = MouseInfo.getPointerInfo();
int px = pi.getLocation().x
- this.button.getLocationOnScreen().x;
int py = pi.getLocation().y
- this.button.getLocationOnScreen().y;
this.button.getModel()
.setRollover(this.button.contains(px, py));
} catch (AccessControlException ace) {
// sandbox - give up
}
} finally {
this.stateTransitionTracker.onModelStateChanged();
}
}
代码示例来源:origin: com.github.insubstantial/substance
@Override
public void focusGained(FocusEvent e) {
this.stateTransitionTracker.turnOffModelChangeTracking();
try {
super.focusGained(e);
if (!this.button.isShowing()) {
// shouldn't happen. Is some lurking Swing bug
return;
}
try {
PointerInfo pi = MouseInfo.getPointerInfo();
if (pi == null) return; //pointer not on a graphics device
int px = pi.getLocation().x
- this.button.getLocationOnScreen().x;
int py = pi.getLocation().y
- this.button.getLocationOnScreen().y;
this.button.getModel()
.setRollover(this.button.contains(px, py));
} catch (AccessControlException ace) {
// sandbox - give up
}
} finally {
this.stateTransitionTracker.onModelStateChanged();
}
}
内容来源于网络,如有侵权,请联系作者删除!