Setting the Tool Tip for a Tab in a JTabbedPane Container
import javax.swing.JButton;
import javax.swing.JTabbedPane;
public class Main {
public static void main(String[] argv) throws Exception {
JTabbedPane pane = new JTabbedPane();
String label = "Tab Label";
String tooltip = "Tool Tip Text";
pane.addTab(label, null, new JButton("Button"), tooltip);
int index = pane.getTabCount() - 1;
tooltip = pane.getToolTipTextAt(index);
tooltip = "New Tool Tip Text";
pane.setToolTipTextAt(index, tooltip);
}
}
Related examples in the same category