import javafx.scene.Scene; import javafx.scene.text.Font; import javafx.scene.text.Text; import javafx.stage.Stage; import javafx.scene.control.*; var urlBox: TextBox; var hyperLink: Hyperlink; Stage { title: "HyperLink" width: 300 height: 200 scene: Scene { content: [ Text{ content: "Opening a URL Demo" translateX: 10 translateY: 40 font:Font{ size: 15 } }, Label{ text: "Enter the URL" translateX: 10 translateY: 70 width: 100 }, urlBox=TextBox{ translateX: 120 translateY: 70 width: 100 action: function():Void{ UrlOpener{}.openURL(urlBox.text); } }, hyperLink=Hyperlink{ translateY: 100 width: 200 text: bind "Visit {urlBox.text}" action: function():Void{ UrlOpener{}.openURL(urlBox.text); } } ] } }