Here you can find the source of getTabIndex(final JTabbedPane tabs, final String title)
static int getTabIndex(final JTabbedPane tabs, final String title)
//package com.java2s; //License from project: Apache License import javax.swing.JTabbedPane; public class Main { static int getTabIndex(final JTabbedPane tabs, final String title) { for (int i = 0; i < tabs.getTabCount(); i++) { if (tabs.getTitleAt(i).equals(title)) { return i; }/*from w ww. j av a2 s . c om*/ } return -1; } }