Quant à JavaFX, il n'y a pas beaucoup de documents japonais, je vais donc le résumer.
L'édition FXML peut ou non utiliser SceneBuilder.
| Type | version | 
|---|---|
| OS | Windows10 64bit | 
| IntelliJ IDEA | 2017.1.5 | 
| JDK | 1.8.0_121 | 
Voici un exemple de création d'une grille 2x2.
Exemple de volet de grille 2x2
<GridPane gridLinesVisible="true" hgap="10" vgap="10" xmlns="http://javafx.com/javafx/8.0.112"
          xmlns:fx="http://javafx.com/fxml/1" fx:controller="sample.Controller">
    <columnConstraints>
        <ColumnConstraints/>
        <ColumnConstraints/>
    </columnConstraints>
    <rowConstraints>
        <RowConstraints/>
        <RowConstraints/>
    </rowConstraints>
</GridPane>
Vous pouvez étendre la grille en ajoutant des éléments enfants à l'intérieur de columnConstraints, rowConstraints. Il semble que ce ne soit pas très différent des spécifications de WPF Grid.
Mission de contrôle
<GridPane alignment="center" hgap="10" vgap="10" xmlns:fx="http://javafx.com/fxml/1"
          xmlns="http://javafx.com/javafx/8.0.112" fx:controller="sample.Controller">
    <rowConstraints>
        <RowConstraints/>
        <RowConstraints/>
    </rowConstraints>
    <columnConstraints>
        <ColumnConstraints/>
        <ColumnConstraints/>
    </columnConstraints>
    <children>
        <Label text="Label" GridPane.rowIndex="1" GridPane.columnIndex="1"/>
    </children>
</GridPane>
<children> est facultative, et la position de contrôle peut être directement sous GridPane.python
<GridPane hgap="10" vgap="10" xmlns="http://javafx.com/javafx/8.0.112" xmlns:fx="http://javafx.com/fxml/1" fx:controller="sample.Controller">
    <rowConstraints>
        <RowConstraints percentHeight="100" />
    </rowConstraints>
    <columnConstraints>
        <ColumnConstraints percentWidth="50" />
        <ColumnConstraints percentWidth="50"/>
    </columnConstraints>
   <children>
      <TextArea prefHeight="200.0" prefWidth="200.0" />
      <TextArea prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="1" />
   </children>
</GridPane>
Vous pouvez définir un pourcentage pour chaque élément.

todo: Que se passe-t-il lorsque la spécification de taille et la spécification de pourcentage sont combinées?
java - JavaFX - Get GridPane to fit parent - Stack Overflow
Cela semble facile à ajouter à partir du menu contextuel du menu de gauche.

Recommended Posts