Hi,
I have the following JSON string describing the menu items:
Can someone tell me how to translate this into source code in B4J?
I can't get "Selected: True"
Example:
I have the following JSON string describing the menu items:
{Text: "_Help", Children:
[
{Text: "Show Zip Result Window", Selected: True, Shortcut: {Key: "F1"}}
]
}
Can someone tell me how to translate this into source code in B4J?
I can't get "Selected: True"
Example:
MenuItem:
...
Dim MI As MenuItem
MI.Initialize("Show Zip Result Window","Menu")
BLD_Utils.SetShortCutKey(MI,Array As String("Ctrl","R"))
M.MenuItems.Add(MI)
MenuBar1.Menus.Add(M)
'Set a shortcut key for this menu item
'Returns the menu item
Public Sub SetShortCutKey(MI As JavaObject,Combination() As String) As MenuItem
Dim KC As JavaObject
KC.InitializeStatic("javafx.scene.input.KeyCombination")
Dim KCS As String
For i = 0 To Combination.Length - 1
If i > 0 Then KCS = KCS & "+"
KCS = KCS & Combination(i)
Next
MI.RunMethod("setAccelerator",Array(KC.RunMethod("keyCombination",Array(KCS))))
Return MI
End Sub
Last edited: