Sub ResizeToFit(n As JavaObject)
Dim text As JavaObject
text.InitializeNewInstance("javafx.scene.text.Text",Array(n.RunMethod("getText",Null)))
text.RunMethod("setFont",Array(n.RunMethod("getFont",Null)))
Dim bounds As JavaObject = text.RunMethod("getBoundsInLocal",Null)
n.RunMethod("setPrefWidth",Array(bounds.RunMethod("getWidth",Null)))
n.RunMethod("setPrefHeight",Array(bounds.RunMethod("getHeight",Null)))
End Sub