JavaFX-选项卡窗格标题上的调整选项卡(宽度)

JavaFX-选项卡窗格标题上的调整选项卡(宽度),javafx,tabs,tabpanel,Javafx,Tabs,Tabpanel,我想使用 setTabMinWidth()方法 我认为简单的划分就能解决这个问题 tabPane.setTabMinWidth(tabPane.getPrefWidth()/2); // in this approach TabPane add Menu Button on the right. // I also tried to divide my different containers, BorderPane // and the Stage. 然后我尝试了另一

我想使用 setTabMinWidth()方法

我认为简单的划分就能解决这个问题

   tabPane.setTabMinWidth(tabPane.getPrefWidth()/2);
   // in this approach TabPane add Menu Button on the right.
   // I also tried to divide my different containers, BorderPane
   // and the Stage.
然后我尝试了另一种方法

  tabPane.setTabMinWidth((tabPane.getPrefWidth()/2) - 20.0);
  // Minus 20.0 leave atleast 10 to 15 pixels (estimated)
  // from last tab index to edge of the stage.
  // Minus 20.0 below will show Menu Button on the right.
如何将标签完全放在TabPane上

看起来像这样:

您可以单击一个答案。