Get the index of the first tab that matches an icon
import javax.swing.ImageIcon; import javax.swing.JTabbedPane; public class Main { public static void main(String[] argv) throws Exception { JTabbedPane pane = new JTabbedPane(); ImageIcon icon = null; int index = pane.indexOfTab(icon); } }