Hi, TabPane tabs allow you to set graphic nodes as the header and there appears to be no documented limitations or best-practises on this.
You might assume it's perfectly reasonable to not set a Tab's text value, and instead set the header as a HBox, consisting of a graphic node (left) and a Label (itself with a text + a graphic, right), to achieve an icon-text-icon style header, which is not an uncommon. However, the overflow menu, when it kicks in, will not display any text or graphics at all (just a blank space), if your Tab has no "text" set, and the header graphic is not a Label or an ImageView. It's down to this self-confessed hacky code ( https://github.com/openjdk/jfx/blob/f31d00d8f7e601c3bb28a9975dd029390ec92173/modules/javafx.controls/src/main/java/javafx/scene/control/skin/TabPaneSkin.java#L479 ): /** * VERY HACKY - this lets us 'duplicate' Label and ImageView nodes to be used in a * Tab and the tabs menu at the same time. */ private static Node clone(Node n) { if (n == null) { return null; } if (n instanceof ImageView) { ImageView iv = (ImageView) n; ImageView imageview = new ImageView(); imageview.imageProperty().bind(iv.imageProperty()); return imageview; } if (n instanceof Label) { Label l = (Label)n; Label label = new Label(l.getText(), clone(l.getGraphic())); label.textProperty().bind(l.textProperty()); return label; } return null; } It is not obvious at all that this is what's going to happen, or why. And it seems impossible to control or influence this in any reasonable way, without replacing the whole TabPaneSkin. Given TabPane is one of the most important and widely used controls there is, there could/should be some of the following: - Proper documentation on this limitation / behaviour - Some way to set fallback text that can be used in the menu (i.e., that isn't the Tab's header's text, because one might intentionally avoid setting that given there's no way to hide it from the tab header) - Or, better yet, some way to allow you to specify tab header text without displaying it in the actual tab header, which could then be used by the hacky method as normal - Some way to set a callback so the developer can decide what gets displayed for the overflow menu - Some way to override the skin without needing a full copy + paste + rename - Some way to allow the dev to disable the overflow menu, if it's going to produce something unusable. E.g., prefer no menu than a buggy one... I would view this as a bug, even though it's probably been like this forever. Some sample code to demonstrate; just look at the menu: public class TabPaneMenu extends Application { @Override public void start(Stage primaryStage) { TabPane tabPane = new TabPane(); for (int i = 1; i <= 30; i++) { Tab tab; if (i == 2) { tab = new Tab(); final Label label = new Label("HBox Tab " + i); final HBox hBox = new HBox(label); // Will show as blank in overflow menu! tab.setGraphic(hBox); } else if (i == 5) { tab = new Tab(); tab.setGraphic(new Label("Label Tab " + i)); // Will show in overflow menu, because it's a Label } else { tab = new Tab("Normal Tab " + i); } tab.setContent(new StackPane(new Label("This is Tab " + i))); tab.setClosable(false); tabPane.getTabs().add(tab); } Scene scene = new Scene(tabPane, 800, 600); primaryStage.setScene(scene); primaryStage.show(); } public static void main(String[] args) { launch(args); } } Kind Regards, *Cormac Redmond* Software Engineer, Certak Ltd. e: credm...@certak.com | m: +353 (0) 86 268 2152 | w: www.certak.com