Sub SetUpWindow(Title As String,IconDir As String,IconFile As String)
Dim Image1 As Image
MainForm.Title = Title
MainForm.SetFormStyle("DECORATED")
'Get image for icon
Image1.Initialize(IconDir,IconFile)
'Use JavaObject to get the Node we need
Dim JO As JavaObject = MainForm.RootPane
JO =JO.RunMethod("getScene",Null)
JO = JO.RunMethod("getWindow",Null)
'Get the current Icon List for the node
Dim SIcons As List = JO.RunMethod("getIcons",Null)
'Add icon to Stage/Window
SIcons.Add(Image1)
End Sub