在已设置内容的 tabpane 上加载内容

Loading content on tabpane with content already set

我想知道是否可以在加载新内容时保留标签页的内容。 顺便说一句,我正在使用 fxml。

FXML

<content>
    <Rectangle fx:id="borderBottom"  x="0" y="500" width="500" />
    <!-- When I load the file this rectangles disappears. -->
    <fx:include source="someOtherFxml.fxml"/>
</content>

我想知道如何将矩形保留在选项卡窗格中并且仍然能够加载文件。现在,当我加载 fxml 文件时,矩形消失了。

控制器

package newasa;

import java.net.URL;
import java.util.ResourceBundle;
import javafx.fxml.Initializable;


public class AppseController implements Initializable {


@Override
public void initialize(URL url, ResourceBundle rb) {
    // TODO
}    

}

用一些布局窗格包裹选项卡内容。例如:

<content>
  <VBox>
    <children>
      <Rectangle fx:id="borderBottom"  x="0" y="500" width="500" />
      <fx:include source="someOtherFxml.fxml"/>
   </children>
  </VBox>
</content>