JavaFX: tailles élastiques #
À l’intérieur d’un HBox #
- 
Les conteneurs grandissent automatiquement en hauteur:   <HBox xmlns:fx="http://javafx.com/fxml"> <HBox> <CheckBox text="1"/> </HBox> <HBox> <CheckBox text="2"/> </HBox> </HBox>
- 
Pour qu’un conteneur grandisse en largeur, il faut ajouter HBox.hgrow="ALWAYS"  <HBox xmlns:fx="http://javafx.com/fxml"> <HBox HBox.hgrow="ALWAYS"> <CheckBox text="1"/> </HBox> <HBox HBox.hgrow="ALWAYS"> <CheckBox text="2"/> </HBox> </HBox>
À l’intérieur d’un VBox #
- 
Les conteneurs grandissent automatiquement en largeur:   <VBox xmlns:fx="http://javafx.com/fxml"> <HBox> <CheckBox text="1"/> </HBox> <HBox> <CheckBox text="2"/> </HBox> </VBox>
- 
Pour qu’un conteneur grandisse en hauteur, il faut ajouter VBox.vgrow="ALWAYS"  <VBox xmlns:fx="http://javafx.com/fxml"> <HBox VBox.vgrow="ALWAYS"> <CheckBox text="1"/> </HBox> <HBox VBox.vgrow="ALWAYS"> <CheckBox text="2"/> </HBox> </VBox>
    
    
    
    
        
        
        
        
    
    
Attention: HBox.hgrow faire référence au parent
    #
- 
On peut appliquer à n’importe quel composant 
- 
La signification est: si je suis à l’intérieur d’un HBox, alors je grandis en largeur   <HBox> <Button text="1"/> <Button text="2" maxWidth="Infinity" HBox.hgrow="ALWAYS"/> </HBox>
    
    
    
    
        
        
        
        
    
    
Attention: VBox.vgrow faire référence au parent
    #
- 
On peut appliquer à n’importe quel composant 
- 
La signification est: si je suis à l’intérieur d’un VBox, alors je grandis en hauteur   <VBox xmlns:fx="http://javafx.com/fxml"> <Button text="1"/> <Button text="2" maxHeight="Infinity" VBox.vgrow="ALWAYS"/> </VBox>
Exemples du tutoriel 07 #
- 
Sans tailles élastiques     
- 
Avec tailles élastiques     
- 
En action