当前位置: 首页>>代码示例>>Java>>正文


Java JTabbedPane.getSelectedComponent方法代码示例

本文整理汇总了Java中javax.swing.JTabbedPane.getSelectedComponent方法的典型用法代码示例。如果您正苦于以下问题:Java JTabbedPane.getSelectedComponent方法的具体用法?Java JTabbedPane.getSelectedComponent怎么用?Java JTabbedPane.getSelectedComponent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.JTabbedPane的用法示例。


在下文中一共展示了JTabbedPane.getSelectedComponent方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: closeAllButCurrent

import javax.swing.JTabbedPane; //导入方法依赖的package包/类
void closeAllButCurrent() {
    Component comp = getComponent(0);
    if (comp instanceof JTabbedPane) {
        JTabbedPane tabs = (JTabbedPane) comp;
        Component current = tabs.getSelectedComponent();
        int tabCount = tabs.getTabCount();
        // #172039: do not use tabs.getComponents()
        Component[] c = new Component[tabCount - 1];
        for (int i = 0, j = 0; i < tabCount; i++) {
            Component tab = tabs.getComponentAt(i);
            if (tab != current) {
                c[j++] = tab;
            }
        }
        for (int i = 0; i < c.length; i++) {
            ((RefactoringPanel) c[i]).close();
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:RefactoringPanelContainer.java

示例2: getRefactoringPanelComp

import javax.swing.JTabbedPane; //导入方法依赖的package包/类
private Component getRefactoringPanelComp() {
    RefactoringPanel.checkEventThread();
    Component comp = getComponentCount() > 0 ? getComponent(0) : null;
    if (comp instanceof JTabbedPane) {
        JTabbedPane tabs = (JTabbedPane) comp;
        return tabs.getSelectedComponent();
    } else {
        return comp;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:RefactoringPanelContainer.java

示例3: getCurrentPanel

import javax.swing.JTabbedPane; //导入方法依赖的package包/类
public RefactoringPanel getCurrentPanel() {
    if (getComponentCount() > 0) {
        Component comp = getComponent(0);
        if (comp instanceof JTabbedPane) {
            JTabbedPane tabs = (JTabbedPane) comp;
            return (RefactoringPanel) tabs.getSelectedComponent();
        } else {
            if (comp instanceof RefactoringPanel)
                return (RefactoringPanel) comp;
        }
    }
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:RefactoringPanelContainer.java

示例4: getSelectedData

import javax.swing.JTabbedPane; //导入方法依赖的package包/类
private TestDataTablePanel getSelectedData() {
    if (envTab.getSelectedComponent() instanceof JTabbedPane) {
        JTabbedPane tab = (JTabbedPane) envTab.getSelectedComponent();
        if (tab.getTabCount() > 0 && tab.getSelectedComponent() != null
                && tab.getSelectedComponent() instanceof TestDataTablePanel) {
            return (TestDataTablePanel) tab.getSelectedComponent();
        }
    }
    return null;
}
 
开发者ID:CognizantQAHub,项目名称:Cognizant-Intelligent-Test-Scripter,代码行数:11,代码来源:TestDataComponent.java


注:本文中的javax.swing.JTabbedPane.getSelectedComponent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。