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


Java JTabbedPane.getTabCount方法代码示例

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


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

示例1: handleNotFound

import javax.swing.JTabbedPane; //导入方法依赖的package包/类
private void handleNotFound(String id, String exactCategory, String exactTabTitle) {
    if (!disabledCategories.contains(id)) {
        disabledCategories.add(id);
    }
    JTabbedPane pane = categoryid2tabbedpane.get(id);
    if (categoryid2tabs.get(id) != null && pane != null) {
        for (int i = 0; i < pane.getTabCount(); i++) {
            pane.setEnabledAt(i, false);
        }
    }
    buttons.get(id).setEnabled(false);
    if (disabledCategories.size() == buttons.size()) {
        setCurrentCategory(null, null);
    } else {
        for (String id3 : categoryModel.getCategoryIDs()) {
            if (buttons.get(id3).isEnabled() && ((exactCategory != null && exactCategory.equals(id3)) || (exactCategory == null && exactTabTitle == null))) {
                setCurrentCategory(categoryModel.getCategory(id3), null);
                break;
            }
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:OptionsPanel.java

示例2: test

import javax.swing.JTabbedPane; //导入方法依赖的package包/类
private static void test() {

        int N = 5;
        JTabbedPane tabbedPane = new JTabbedPane();

        for (int i = 0; i < N; i++) {
            tabbedPane.addTab("Title: " + i, new JLabel("Component: " + i));
        }

        for (int i = 0; i < tabbedPane.getTabCount(); i++) {
            Component child = tabbedPane.getComponentAt(i);

            AccessibleContext ac = child.getAccessibleContext();
            if (ac == null) {
                throw new RuntimeException("Accessible Context is null!");
            }

            int index = ac.getAccessibleIndexInParent();
            Accessible parent = ac.getAccessibleParent();

            if (parent.getAccessibleContext().getAccessibleChild(index) != child) {
                throw new RuntimeException("Wrong getAccessibleIndexInParent!");
            }
        }
    }
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:26,代码来源:AccessibleIndexInParentTest.java

示例3: 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

示例4: componentClosed

import javax.swing.JTabbedPane; //导入方法依赖的package包/类
@Override
protected void componentClosed() {
    isVisible = false;
    if (getComponentCount() == 0) {
        return ;
    }
    Component comp = getComponent(0);
    if (comp instanceof JTabbedPane) {
        JTabbedPane pane = (JTabbedPane) comp;
        // #172039: do not use tabs.getComponents()
        Component[] c = new Component[pane.getTabCount()];
        for (int i = 0; i < c.length; i++) {
            c[i] = pane.getComponentAt(i);
        }
        for (int i = 0; i < c.length; i++) {
            ((RefactoringPanel) c[i]).close();
        }
    } else if (comp instanceof RefactoringPanel) {
        ((RefactoringPanel) comp).close();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:RefactoringPanelContainer.java

示例5: setTabTitle

import javax.swing.JTabbedPane; //导入方法依赖的package包/类
/**
 * Sets the tab title.
 */
private void setTabTitle() {
	
	String tabTitle = "";
	if (this.getSeriesTableModels().size()==0) {
		tabTitle = "Table (0)";
	} else {
		tabTitle = "Table (" + (currSeriesSelection+1) + "/" +  this.getSeriesTableModels().size() + ")";
	}
	Container tableTab = this.myJTable.getParent().getParent().getParent();
	JTabbedPane editorTabbedPane =(JTabbedPane) tableTab.getParent();
	if (editorTabbedPane!=null) {
		int tabPosIndex = 0;
		for (tabPosIndex=0; tabPosIndex<editorTabbedPane.getTabCount(); tabPosIndex++) {
			if (editorTabbedPane.getComponentAt(tabPosIndex)==tableTab) {
				break;
			}
		}
		editorTabbedPane.setTitleAt(tabPosIndex, tabTitle);
	}
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:24,代码来源:XyTableModel.java

示例6: navigateToTestData

import javax.swing.JTabbedPane; //导入方法依赖的package包/类
public Boolean navigateToTestData(String sheetName, String columnName) {
    if (envTab.getSelectedComponent() instanceof JTabbedPane) {
        JTabbedPane tab = (JTabbedPane) envTab.getSelectedComponent();
        for (int i = 0; i < tab.getTabCount(); i++) {
            if (tab.getComponentAt(i) instanceof TestDataTablePanel) {
                TestDataTablePanel tdPanel = (TestDataTablePanel) tab.getComponentAt(i);
                if (tdPanel.std.getName().equals(sheetName)) {
                    int colIndex = tdPanel.std.getColumnIndex(columnName);
                    if (colIndex != -1) {
                        tab.setSelectedIndex(i);
                        tdPanel.table.selectColumn(colIndex);
                        return true;
                    }
                    break;
                }
            }
        }
    }
    return false;
}
 
开发者ID:CognizantQAHub,项目名称:Cognizant-Intelligent-Test-Scripter,代码行数:21,代码来源:TestDataComponent.java

示例7: showedTabAt

import javax.swing.JTabbedPane; //导入方法依赖的package包/类
private int showedTabAt(JTabbedPane tabbedPane, String title) {
	// TODO Auto-generated method stub
	int exist = -1;
	int i=0;
	while ((i<tabbedPane.getTabCount()) && (!title.equals(tabbedPane.getTitleAt(i))))
		i++;
	
	if(i == tabbedPane.getTabCount())
		return -1;
	
	else
		return i;
}
 
开发者ID:BlidiWajdi,项目名称:Mujeed-Arabic-Prolog,代码行数:14,代码来源:OpenFileListener.java

示例8: getNextEnabledTabIndex

import javax.swing.JTabbedPane; //导入方法依赖的package包/类
private int getNextEnabledTabIndex(JTabbedPane pane, int currentIndex) {
    for (int i = currentIndex + 1; i < pane.getTabCount(); i++) {
        if(pane.isEnabledAt(i)) {
            return i;
        }
    }
    for (int i = 0; i < currentIndex; i++) {
        if(pane.isEnabledAt(i)) {
            return i;
        }
    }
    return -1;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:OptionsPanel.java

示例9: clearAllinQS

import javax.swing.JTabbedPane; //导入方法依赖的package包/类
private void clearAllinQS() {
clearSearch = true;
for (String id : categoryModel.getCategoryIDs()) {
    JTabbedPane pane = categoryid2tabbedpane.get(id);
    if (categoryid2tabs.get(id) != null && pane != null) {
	for (int i = 0; i < pane.getTabCount(); i++) {
	    pane.setEnabledAt(i, true);
	}
    }
    buttons.get(id).setEnabled(true);
}
setCurrentCategory(categoryModel.getCurrent(), null);
disabledCategories.clear();
categoryModel.getCurrent().handleSuccessfulSearchInController(null, null);
   }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:OptionsPanel.java

示例10: selectJWTSuiteTab

import javax.swing.JTabbedPane; //导入方法依赖的package包/类
public void selectJWTSuiteTab() {
	Component current = this.getUiComponent();
	do {
		current = current.getParent();
	} while (!(current instanceof JTabbedPane));

	JTabbedPane tabPane = (JTabbedPane) current;
	for (int i = 0; i < tabPane.getTabCount(); i++) {
		if (tabPane.getTitleAt(i).equals(this.getTabCaption()))
			tabPane.setSelectedIndex(i);
	}
}
 
开发者ID:mvetsch,项目名称:JWT4B,代码行数:13,代码来源:JWTSuiteTabController.java

示例11: findTabIndex

import javax.swing.JTabbedPane; //导入方法依赖的package包/类
private int findTabIndex(JTabbedPane tp, String tab) {
    int tabCount = tp.getTabCount();
    int tabIndex = -1;
    for (int index = 0; index < tabCount; index++) {
        String current = JTabbedPaneTabJavaElement.getText(tp, index);
        if (tab.equals(current)) {
            tabIndex = index;
            break;
        }
    }
    return tabIndex;
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:13,代码来源:JTabbedPaneJavaElement.java

示例12: getContent

import javax.swing.JTabbedPane; //导入方法依赖的package包/类
public static String[][] getContent(JTabbedPane component) {
    int nItems = component.getTabCount();
    String[][] content = new String[1][nItems];
    for (int i = 0; i < nItems; i++) {
        content[0][i] = JTabbedPaneTabJavaElement.getText(component, i);
    }
    return content;
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:9,代码来源:JTabbedPaneJavaElement.java

示例13: addTab

import javax.swing.JTabbedPane; //导入方法依赖的package包/类
public void addTab(JTabbedPane workspace, JTabContent tab, boolean autoSwitch) {
	workspace.addTab(tab.getName(), tab);
	final int index = workspace.getTabCount() - 1;
	workspace.setTabComponentAt(index, new JTabPanel(tab));
	if (autoSwitch) {
		workspace.getModel().setSelectedIndex(index);
	}
}
 
开发者ID:roscisz,项目名称:KernelHive,代码行数:9,代码来源:WorkspaceHelper.java

示例14: createSyntaxHelp

import javax.swing.JTabbedPane; //导入方法依赖的package包/类
/** Creates and returns a panel for the syntax descriptions. */
private JComponent createSyntaxHelp() {
    initSyntax();
    final JTabbedPane tabbedPane = new JTabbedPane();
    final int nodeTabIndex = tabbedPane.getTabCount();
    tabbedPane.addTab("Nodes",
        null,
        createSyntaxList(this.nodeKeys),
        "Label prefixes that are allowed on nodes");
    final int edgeTabIndex = tabbedPane.getTabCount();
    tabbedPane.addTab("Edges",
        null,
        createSyntaxList(this.edgeKeys),
        "Label prefixes that are allowed on edges");
    if (this.role == GraphRole.RULE) {
        tabbedPane.addTab("RegExpr", null, createSyntaxList(RegExpr.getDocMap()
            .keySet()), "Syntax for regular expressions over labels");
        tabbedPane.addTab("Expr", null, createSyntaxList(Algebras.getDocMap()
            .keySet()), "Available attribute operators");
    }
    JPanel result = new TitledPanel("Label syntax help", tabbedPane, null, false);
    // add a listener that switches the syntax help between nodes and edges
    // when a cell edit is started in the JGraph
    getJGraph().addPropertyChangeListener(new PropertyChangeListener() {
        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            if (evt.getPropertyName() == JGraph.CELL_EDIT_PROPERTY) {
                int index =
                    evt.getNewValue() instanceof AspectJEdge ? edgeTabIndex : nodeTabIndex;
                tabbedPane.setSelectedIndex(index);
            }
        }
    });
    return result;
}
 
开发者ID:meteoorkip,项目名称:JavaGraph,代码行数:36,代码来源:GraphEditorTab.java

示例15: openTab

import javax.swing.JTabbedPane; //导入方法依赖的package包/类
private void openTab(Component component, JTabbedPane pane) {
    for (int i = 0; i < pane.getTabCount(); i++) {
        if (component == pane.getComponentAt(i)) {
            pane.setSelectedIndex(i);
            break;
        }
    }
}
 
开发者ID:Vitaliy-Yakovchuk,项目名称:ramus,代码行数:9,代码来源:Control.java


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