Example usage for javax.swing JTabbedPane indexOfTab

List of usage examples for javax.swing JTabbedPane indexOfTab

Introduction

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

Prototype

public int indexOfTab(Icon icon) 

Source Link

Document

Returns the first tab index with a given icon, or -1 if no tab has this icon.

Usage

From source file:Main.java

public static void main(String[] argv) throws Exception {
    JTabbedPane pane = new JTabbedPane();
    ImageIcon icon = null;/*from   ww w . j  a  v a 2  s. com*/
    int index = pane.indexOfTab(icon);

}

From source file:Main.java

public static void main(String[] argv) throws Exception {
    JTabbedPane pane = new JTabbedPane();
    // Get the index of the first tab that matches a label
    String label = "Tab Label";
    int index = pane.indexOfTab(label);

}