### Set the MainForm Icon

Instead of using the MainForm.Icon option, it is also possible to use JavaObjects to
set the title icon.
The icon must be placed in the same folder as the project.jar.
During development this is the objects folder.
Dim Image1 As Image
MainForm.Title = "App Title"
MainForm.SetFormStyle("DECORATED") ' Allows flexible form design
Image1.Initialize(File.DirApp,"formtitle.png") ' Get image for icon
Dim JO As JavaObject = MainForm.RootPane ' Use JavaObject to get the node required
JO = JO.RunMethod("getScene",Null) ' Get the scene first
JO = JO.RunMethod("getWindow",Null) ' Which is then used to get the window
Dim SIcons As List = JO.RunMethod("getIcons",Null)' Get the icon list for the node
SIcons.Add(Image1) ' Add the icon to the window
MainForm.Show

Changed: 2018-03-28 10:21, Category: JavaObject, File: T6C208M1526.htm, ID: 1526