Insert a tab after the first tab
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JTabbedPane;
public class Main {
public static void main(String[] argv) throws Exception {
JTabbedPane pane = new JTabbedPane();
JButton component = new JButton("button");
int index = 1;
pane.insertTab("label", new ImageIcon("icon.png"), component, "tooltip", index);
}
}
Related examples in the same category