Example usage for javax.swing JTabbedPane getComponentCount

List of usage examples for javax.swing JTabbedPane getComponentCount

Introduction

In this page you can find the example usage for javax.swing JTabbedPane getComponentCount.

Prototype

public int getComponentCount() 

Source Link

Document

Gets the number of components in this panel.

Usage

From source file:Main.java

public static int getIndexOf(JTabbedPane tabbedPane, Component component) {
    int result = -1;
    for (int i = 0; i < tabbedPane.getComponentCount(); i++) {
        Component comp = tabbedPane.getComponentAt(i);
        if (comp == component) {
            result = i;/*ww  w.  ja  va2s . c o  m*/
            break;
        }
    }
    return result;
}