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

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

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

JComponent.isRequestFocusEnabled介绍

暂无

代码示例

代码示例来源:origin: igniterealtime/Openfire

if (c instanceof JComponent) {
  JComponent jc = (JComponent) c;
  if (jc.isRequestFocusEnabled()) {
    return jc;
if (deepest == true) {
  JComponent jc = (JComponent) c;
  if (jc.isRequestFocusEnabled()) {
    return jc;

代码示例来源:origin: org.swinglabs.swingx/swingx-core

public static void adjustFocus(JComponent component) {
  if ((!(component.hasFocus())) && (component.isRequestFocusEnabled()))
    component.requestFocus();
}

代码示例来源:origin: org.swinglabs.swingx/swingx-all

public static void adjustFocus(JComponent component) {
  if ((!(component.hasFocus())) && (component.isRequestFocusEnabled()))
    component.requestFocus();
}

代码示例来源:origin: org.bidib.jbidib.swinglabs.swingx/swingx-core

public static void adjustFocus(JComponent component) {
  if ((!(component.hasFocus())) && (component.isRequestFocusEnabled()))
    component.requestFocus();
}

代码示例来源:origin: com.haulmont.thirdparty/swingx-core

public static void adjustFocus(JComponent component) {
  if ((!(component.hasFocus())) && (component.isRequestFocusEnabled()))
    component.requestFocus();
}

代码示例来源:origin: igniterealtime/Spark

if (c instanceof JComponent) {
JComponent jc = (JComponent) c;
if (jc.isRequestFocusEnabled()) {
  return jc;
if (deepest) {
JComponent jc = (JComponent) c;
if (jc.isRequestFocusEnabled()) {
  return jc;

代码示例来源:origin: net.sf.tinylaf/tinylaf

public void mousePressed(MouseEvent e) {
  if(!tabPane.isEnabled()) return;
  // 1.3.04 code - see getTabAtLocation(int, int) for
  // JRE 1.5 fix
  int tabIndex = getTabAtLocation(e.getX(), e.getY());
  if(tabIndex >= 0 && tabPane.isEnabledAt(tabIndex)) {
    if(tabIndex != tabPane.getSelectedIndex()) {
      // Clicking on unselected tab, change selection, do NOT
      // request focus.
      // This will trigger the focusIndex to change by way
      // of stateChanged.
      tabPane.setSelectedIndex(tabIndex);
    }
    else if(tabPane.isRequestFocusEnabled()) {
      // Clicking on selected tab, try and give the tabbedpane
      // focus.  Repaint will occur in focusGained.
      tabPane.requestFocus();
    }
  }
}

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-bu

b=((JComponent)o).isRequestFocusEnabled();

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

/**
 * This is is a utility method that helps event handlers figure out where to
 * send the focus when the popup is brought up. The standard implementation
 * delegates the focus to the editor (if the combo box is editable) or to
 * the JComboBox if it is not editable.
 */
protected void delegateFocus(MouseEvent e) {
  if (comboBox.isEditable()) {
    Component comp = comboBox.getEditor().getEditorComponent();
    if ((!(comp instanceof JComponent))
        || ((JComponent) comp).isRequestFocusEnabled()) {
      comp.requestFocus();
    }
  } else if (comboBox.isRequestFocusEnabled()) {
    comboBox.requestFocus();
  }
}

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

public void mousePressed(MouseEvent e) {
  if (e.getSource() == list) {
    return;
  }
  if (!SwingUtilities.isLeftMouseButton(e) || !comboBox.isEnabled())
    return;
  if (comboBox.isEditable()) {
    Component comp = comboBox.getEditor().getEditorComponent();
    if ((!(comp instanceof JComponent))
        || ((JComponent) comp).isRequestFocusEnabled()) {
      comp.requestFocus();
    }
  } else if (comboBox.isRequestFocusEnabled()) {
    comboBox.requestFocus();
  }
  togglePopup();
}

代码示例来源:origin: stackoverflow.com

if (currentFocusOwner instanceof JComponent) {
  focusNotFound = (((JComponent) currentFocusOwner)
      .isRequestFocusEnabled() == false);

代码示例来源:origin: net.sf.tinylaf/tinylaf

/**
   * Requests focus on a child of the spinner if the spinner doesn't
   * have focus.
   */
  private void focusSpinnerIfNecessary() {
    Component fo = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
    if(spinner.isRequestFocusEnabled() && (fo == null || !SwingUtilities.isDescendingFrom(fo, spinner))) {
      Container root = spinner;
      if(!root.isFocusCycleRoot()) {
        root = root.getFocusCycleRootAncestor();
      }
      if(root != null) {
        FocusTraversalPolicy ftp = root.getFocusTraversalPolicy();
        Component child = ftp.getComponentAfter(root, spinner);
        if(child != null && SwingUtilities.isDescendingFrom(child, spinner)) {
          child.requestFocus();
        }
      }
    }
  }
}

代码示例来源:origin: net.sf.cuf/cuf-swing

if (((JComponent)mLastFocusOwner).isRequestFocusEnabled())

相关文章

JComponent类方法