import javafx.application.Application; 
import javafx.beans.binding.Bindings; 
import javafx.scene.Scene; 
import javafx.scene.control.Label; 
import javafx.scene.layout.VBox; 
import javafx.scene.text.Text; 
import javafx.stage.Stage; 

/** 
 * 
 * @author Dean 
 */ 
public class FontSizeTest extends Application { 

    @Override 
    public void start(Stage primaryStage) { 
        int levels = 5; 
        VBox root = new VBox(); 
        root.setStyle("-fx-font-size:8pt"); 
        VBox A = new VBox(); 
        VBox B = new VBox(); 
        A.setStyle("-fx-font-size:1em;"); 
        Text textA = new Text("TextA Test"); 
        Text textB = new Text("TextB Test"); 

        Label labelAFont = new Label(); 
        Label labelBFont = new Label(); 
        labelAFont.textProperty().bind(Bindings.concat("Text A Font: ", textA.fontProperty().asString())); 
        labelBFont.textProperty().bind(Bindings.concat("Text B Font: ", textB.fontProperty().asString())); 
        Label labelABounds = new Label(); 
        Label labelBBounds = new Label(); 
        labelABounds.textProperty().bind(Bindings.concat("Text A Bounds: ", textA.layoutBoundsProperty().asString())); 
        labelBBounds.textProperty().bind(Bindings.concat("Text B Bounds: ", textB.layoutBoundsProperty().asString())); 

        A.getChildren().addAll(textA, labelAFont, labelABounds); 
        B.getChildren().addAll(textB, labelBFont, labelBBounds); 
        root.getChildren().addAll(A, B); 
        Scene scene = new Scene(root, 600, 250); 

        primaryStage.setTitle("Font Size Test"); 
        primaryStage.setScene(scene); 
        primaryStage.show(); 

    } 

    /** 
     * @param args the command line arguments 
     */ 
    public static void main(String[] args) { 
        launch(args); 
    } 

} 