拖动窗格以在JavaFX中展开或收缩

拖动窗格以在JavaFX中展开或收缩,java,javafx,fxml,Java,Javafx,Fxml,我的HBox里面有三个窗格 <HBox prefHeight="100.0" prefWidth="200.0" BorderPane.alignment="CENTER"> <children> <Pane id="First" prefHeight="200.0" prefWidth="200.0" /> <Pane id="Second" prefHeight="200.0" prefWidth="200.0" /&g

我的HBox里面有三个窗格

<HBox prefHeight="100.0" prefWidth="200.0" BorderPane.alignment="CENTER">
   <children>
      <Pane id="First" prefHeight="200.0" prefWidth="200.0" />
      <Pane id="Second" prefHeight="200.0" prefWidth="200.0" />
      <Pane id="Third" prefHeight="200.0" prefWidth="200.0" />
   </children>
</HBox>

我想拖动第一个窗格和第二个窗格之间的边框。所以-

  • 当我向左拖动边框时,第一个窗格变小,第二个窗格变大

  • 当我向右拖动边框时,第一个窗格变大,第二个窗格变小

  • 我希望下图能解释我的要求


    您应该将第一个和第二个窗格放入拆分窗格:

    
    
    使用