本文整理匯總了Java中javax.swing.SwingUtilities.getAncestorNamed方法的典型用法代碼示例。如果您正苦於以下問題:Java SwingUtilities.getAncestorNamed方法的具體用法?Java SwingUtilities.getAncestorNamed怎麽用?Java SwingUtilities.getAncestorNamed使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.swing.SwingUtilities
的用法示例。
在下文中一共展示了SwingUtilities.getAncestorNamed方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: eventDispatched
import javax.swing.SwingUtilities; //導入方法依賴的package包/類
public void eventDispatched(java.awt.AWTEvent aWTEvent) {
if (aWTEvent instanceof MouseEvent) {
MouseEvent mv = (MouseEvent)aWTEvent;
if (mv.getID() == MouseEvent.MOUSE_CLICKED && mv.getClickCount() > 0) {
//#118828
if (! (aWTEvent.getSource() instanceof Component)) {
removePopup();
return;
}
Component comp = (Component)aWTEvent.getSource();
Container par1 = SwingUtilities.getAncestorNamed(POPUP_NAME, comp); //NOI18N
Container par2 = SwingUtilities.getAncestorNamed(SUB_POPUP_NAME, comp); //NOI18N
// Container barpar = SwingUtilities.getAncestorOfClass(PopupUtil.class, comp);
// if (par == null && barpar == null) {
if ( par1 == null && par2 == null ) {
removePopup();
}
}
}
}
示例2: eventDispatched
import javax.swing.SwingUtilities; //導入方法依賴的package包/類
public @Override void eventDispatched(java.awt.AWTEvent aWTEvent) {
if (aWTEvent instanceof MouseEvent) {
MouseEvent mv = (MouseEvent)aWTEvent;
if (mv.getClickCount() > 0) {
//#118828
if (! (aWTEvent.getSource() instanceof Component)) {
return;
}
Component comp = (Component)aWTEvent.getSource();
Container par = SwingUtilities.getAncestorNamed("progresspopup", comp); //NOI18N
Container barpar = SwingUtilities.getAncestorOfClass(StatusLineComponent.class, comp);
if (par == null && barpar == null) {
hidePopup();
}
}
}
}
示例3: eventDispatched
import javax.swing.SwingUtilities; //導入方法依賴的package包/類
public void eventDispatched(java.awt.AWTEvent aWTEvent) {
if (aWTEvent instanceof MouseEvent) {
MouseEvent mv = (MouseEvent)aWTEvent;
if (mv.getID() == MouseEvent.MOUSE_CLICKED && mv.getClickCount() > 0) {
//#118828
if (! (aWTEvent.getSource() instanceof Component)) {
hidePopup();
return;
}
Component comp = (Component)aWTEvent.getSource();
Container par = SwingUtilities.getAncestorNamed(POPUP_NAME, comp); //NOI18N
// Container barpar = SwingUtilities.getAncestorOfClass(PopupUtil.class, comp);
// if (par == null && barpar == null) {
if ( par == null ) {
hidePopup();
}
}
}
}
示例4: eventDispatched
import javax.swing.SwingUtilities; //導入方法依賴的package包/類
@Override
public void eventDispatched(AWTEvent aWTEvent) {
if (aWTEvent instanceof MouseEvent) {
MouseEvent mv = (MouseEvent) aWTEvent;
if (mv.getID() == MouseEvent.MOUSE_CLICKED && mv.getClickCount() > 0) {
//#118828
if (!(aWTEvent.getSource() instanceof Component)) {
hide();
return;
}
Component comp = (Component) aWTEvent.getSource();
Container par1 = SwingUtilities.getAncestorNamed(POPUP_NAME, comp); //NOI18N
if (par1 == null) {
hide();
}
}
}
}