Mega Code Archive

 
Categories / Java / Swing JFC
 

Retrieve the index of a tab when needed

import javax.swing.JTabbedPane; public class Main {   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);   } }