Sub setFileFilters(f As FileChooser,txt() As String, ext() As String)
if txt.length <> ext.length then Log("Error lists not same length")
For a=0 To txt.Length - 1
Dim filter As JavaObject
filter.InitializeNewInstance("javafx.stage.FileChooser.ExtensionFilter",Array(txt(a),Array As String(ext(a))))
f.As(JavaObject).RunMethodJO("getExtensionFilters",Null).RunMethod("add",Array(filter))
Next
End Sub
...
setFileFilters(fc,Array As String("Header C","Header C++"),Array As String("*.h","*.hpp"))