import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.Tab; import javafx.scene.control.TabPane; import javafx.scene.control.Tooltip; import javafx.scene.layout.BorderPane; import javafx.scene.layout.HBox; import javafx.stage.Stage; public class TabPaneTooltips extends Application { public static void main(String[] args) { launch(args); } @Override public void start(Stage stage) throws Exception { BorderPane root = new BorderPane(); TabPane tabPane = new TabPane(); tabPane.setPrefSize(250, 250); for (int i = 0; i < 5; i++) { Tab tab = new Tab("Tab " + i); Tooltip tooltip = new Tooltip(); tooltip.setText("This is a tooltip\nfor tab " + tab.getText()); tab.setTooltip(tooltip); tabPane.getTabs().add(tab); } root.setCenter(tabPane); Scene scene = new Scene(root, 400, 300); stage.setScene(scene); stage.show(); } }