javax.swing.JComponent.requestDefaultFocus()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(100)

本文整理了Java中javax.swing.JComponent.requestDefaultFocus()方法的一些代码示例,展示了JComponent.requestDefaultFocus()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JComponent.requestDefaultFocus()方法的具体详情如下:
包路径:javax.swing.JComponent
类名称:JComponent
方法名:requestDefaultFocus

JComponent.requestDefaultFocus介绍

暂无

代码示例

代码示例来源:origin: org.netbeans.api/org-openide-dialogs

/** Overriden to delegate call to user component.
 */
@Deprecated
@Override
public boolean requestDefaultFocus() {
  if (rightComponent instanceof JComponent) {
    return ((JComponent) rightComponent).requestDefaultFocus();
  }
  return super.requestDefaultFocus();
}

代码示例来源:origin: org.netbeans.api/org-openide-awt

@Override
public void requestFocus() {
  if (browserComponent != null) {
    boolean ownerFound = false;
    if (browserComponent instanceof JComponent) {
      ownerFound = ((JComponent) browserComponent).requestDefaultFocus();
    }
    if (!ownerFound) {
      browserComponent.requestFocus();
    }
  } else {
    super.requestFocus();
  }
}

代码示例来源:origin: org.netbeans.api/org-openide-awt

@Override
public boolean requestFocusInWindow() {
  if (browserComponent != null) {
    boolean ownerFound = false;
    if (browserComponent instanceof JComponent) {
      ownerFound = ((JComponent) browserComponent).requestDefaultFocus();
    }
    if (!ownerFound) {
      return browserComponent.requestFocusInWindow();
    } else {
      return true;
    }
  } else {
    return super.requestFocusInWindow();
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

/** Overriden to delegate call to user component.
 */
public boolean requestDefaultFocus() {
  if (rightComponent instanceof JComponent) {
    return ((JComponent)rightComponent).requestDefaultFocus();
  }
  return super.requestDefaultFocus();
}

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

/** Overriden to delegate call to user component.
 */
public boolean requestDefaultFocus() {
  if (rightComponent instanceof JComponent) {
    return ((JComponent)rightComponent).requestDefaultFocus();
  }
  return super.requestDefaultFocus();
}

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

public void requestFocus() {
  if (browserComponent != null) {
    boolean ownerFound = false;
    if (browserComponent instanceof JComponent) {
      ownerFound = ((JComponent)browserComponent).requestDefaultFocus();
    }
    if (!ownerFound) {
      browserComponent.requestFocus();
    }
  } else {
    super.requestFocus();
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

public void requestFocus() {
  if (browserComponent != null) {
    boolean ownerFound = false;
    if (browserComponent instanceof JComponent) {
      ownerFound = ((JComponent)browserComponent).requestDefaultFocus();
    }
    if (!ownerFound) {
      browserComponent.requestFocus();
    }
  } else {
    super.requestFocus();
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

public boolean requestFocusInWindow() {
  if (browserComponent != null) {
    boolean ownerFound = false;
    if (browserComponent instanceof JComponent) {
      ownerFound = ((JComponent)browserComponent).requestDefaultFocus();
    }
    if (!ownerFound) {
      return browserComponent.requestFocusInWindow();
    } else {
      return true;
    }
  } else {
    return super.requestFocusInWindow();
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

public boolean requestFocusInWindow() {
  if (browserComponent != null) {
    boolean ownerFound = false;
    if (browserComponent instanceof JComponent) {
      ownerFound = ((JComponent)browserComponent).requestDefaultFocus();
    }
    if (!ownerFound) {
      return browserComponent.requestFocusInWindow();
    } else {
      return true;
    }
  } else {
    return super.requestFocusInWindow();
  }
}

代码示例来源:origin: com.synaptix/SynaptixSwing

private boolean requestFocusForVisibleComponent() {
  Component visibleComponent = getVisibleComponent();
  if (visibleComponent != null && visibleComponent.isFocusable()) {
    compositeRequestFocus(visibleComponent);
    return true;
  } else if (visibleComponent instanceof JComponent) {
    if (((JComponent) visibleComponent).requestDefaultFocus()) {
      return true;
    }
  }
  return false;
}

代码示例来源:origin: com.jtattoo/JTattoo

protected boolean requestFocusForVisibleComponent() {
  Component vc = getVisibleComponent();
  if (vc.isFocusTraversable()) {
    vc.requestFocus();
    return true;
  } else if (vc instanceof JComponent) {
    if (((JComponent) vc).requestDefaultFocus()) {
      return true;
    }
  }
  return false;
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/toniclf

boolean requestMyFocusForVisibleComponent()
{
  Component visibleComponent= getVisibleComponent();
  if (visibleComponent.isFocusTraversable())
  {
    visibleComponent.requestFocus();
    return true;
  }
  else if (visibleComponent instanceof JComponent)
  {
    if (((JComponent) visibleComponent).requestDefaultFocus())
    {
      return true;
    }
  }
  return false;
}

代码示例来源:origin: org.bitbucket.goalhub.simpleide/jedit

entry.win.requestDefaultFocus();
entry.win.requestDefaultFocus();

相关文章

JComponent类方法