javax.swing.JTabbedPane.requestFocus()方法的使用及代码示例

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

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

JTabbedPane.requestFocus介绍

暂无

代码示例

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * sets the focus in a designated control
 */
public void setFocus() {
 m_TabbedPane.requestFocus();
}

代码示例来源:origin: com.jidesoft/jide-oss

public void actionPerformed(ActionEvent e) {
    JTabbedPane pane = (JTabbedPane) e.getSource();
    if (!pane.requestFocusInWindow()) {
      pane.requestFocus();
    }
  }
}

代码示例来源:origin: Waikato/weka-trunk

/**
 * sets the focus in a designated control
 */
public void setFocus() {
 m_TabbedPane.requestFocus();
}

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

public void actionPerformed(ActionEvent e) {
    JTabbedPane pane = (JTabbedPane) e.getSource();
    pane.requestFocus();
  }
};

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

public void actionPerformed(ActionEvent e)
  {
    JTabbedPane pane= (JTabbedPane) e.getSource();
    pane.requestFocus();
  }
};

代码示例来源:origin: com.eas.platypus/platypus-js-forms

@ScriptFunction(jsDoc = FOCUS_JSDOC)
@Override
public void focus() {
  super.requestFocus();
}

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

public void mousePressed(MouseEvent e)
  {
    if (!tabPane.isEnabled())
    {
      return;
    }
    int tabIndex= getTabAtLocation(e.getX(), e.getY());
    if (tabIndex >= 0 && tabPane.isEnabledAt(tabIndex))
    {
      if (tabIndex == tabPane.getSelectedIndex())
      {
        if (tabPane.isRequestFocusEnabled())
        {
          tabPane.requestFocus();
          tabPane.repaint(rects[tabIndex]);
        }
      }
      else
      {
        tabPane.setSelectedIndex(tabIndex);
      }
    }
  }
}

代码示例来源:origin: org.java.net.substance/substance

public void mousePressed(MouseEvent e) {
  if (!tabPane.isEnabled()) {
    return;
  }
  int tabIndex = tabForCoordinate(tabPane, e.getX(), e.getY());
  if (tabIndex >= 0 && tabPane.isEnabledAt(tabIndex)) {
    Rectangle rect = new Rectangle();
    rect = getTabBounds(tabIndex, rect);
    Rectangle close = getCloseButtonRectangleForEvents(tabIndex,
        rect.x, rect.y, rect.width, rect.height);
    boolean inCloseButton = close.contains(e.getPoint());
    this.tabOfPressedCloseButton = inCloseButton ? tabIndex : -1;
    if (tabIndex != tabPane.getSelectedIndex()) {
      // enhancement 307 - don't select tab on pressing its
      // close button
      if (inCloseButton) {
        return;
      }
      // 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: com.github.insubstantial/substance

tabPane.requestFocus();

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

public void mousePressed(MouseEvent e) {
  if (scrollableTabLayoutEnabled()) {
    MouseListener[] ml = tabPane.getMouseListeners();
    for (int i = 0; i < ml.length; i++) {
      ml[i].mousePressed(e);
    }
  }
  if (!tabPane.isEnabled()) {
    return;
  }
  int tabIndex = getTabAtLocation(e.getX(), e.getY());
  if (tabIndex >= 0 && tabPane.isEnabledAt(tabIndex)) {
    if (tabIndex == tabPane.getSelectedIndex()) {
      if (tabPane.isRequestFocusEnabled()) {
        tabPane.requestFocus();
        tabPane.repaint(getTabBounds(tabPane, tabIndex));
      }
    } else {
      tabPane.setSelectedIndex(tabIndex);
    }
  }
}

代码示例来源:origin: girtel/Net2Plan

tabPane.requestFocus();

代码示例来源:origin: khuxtable/seaglass

/**
 * @see com.apple.laf.AquaTabbedPaneCopyFromBasicUI$TabbedPaneLayout#layoutContainer(java.awt.Container)
 */
public void layoutContainer(Container parent) {
  setRolloverTab(-1);
  setScrollButtonDirections();
  calculateLayoutInfo();
  boolean shouldChangeFocus = verifyFocus(tabPane.getSelectedIndex());
  if (tabPane.getTabCount() <= 0) {
    return;
  }
  calcContentRect();
  
  for (int i = 0; i < tabPane.getComponentCount(); i++) {
    Component child = tabPane.getComponent(i);
    // Ignore the scroll buttons. They have already been positioned in
    // calculateTabRects, which will have been called by calculateLayoutInfo,
    // which is called above.
    if (child != scrollBackwardButton && child != scrollForwardButton) {
      child.setBounds(contentRect);
    }
  }
  setTabContainerBounds();
  layoutTabComponents();
  if (shouldChangeFocus && !SwingUtilities2.tabbedPaneChangeFocusTo(getVisibleComponent())) {
    tabPane.requestFocus();
  }
}

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

if (shouldChangeFocus) {
  if (!requestFocusForVisibleComponent()) {
    tabPane.requestFocus();

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

if (shouldChangeFocus) {
  if (!requestFocusForVisibleComponent()) {
    tabPane.requestFocus();

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

tabPane.requestFocus();

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

tabPane.requestFocus();

相关文章

JTabbedPane类方法