Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Dim theCode,inline As JavaObject
End Sub
Sub AppStart (Form1 As Form, Args() As String)
inline = Me
MainForm = Form1
MainForm.SetFormStyle("UNIFIED")
MainForm.Show
' you need to know the name of the class contained in the jar
' (jarFile).(className) etc
theCode.InitializeNewInstance("java.lang.String",Null)
Dim s As String = theCode.RunMethod("getClass",Null)
Dim l As List = inline.RunMethod("getMethods",Array(s.replace("class ","")))
For Each item As String In l
Log(item)
Next
End Sub
#if java
import java.util.List;
import java.lang.reflect.Method;
import java.lang.reflect.Constructor;
import java.util.ArrayList;
public static List<String> getMethods(String cname) {
List<String> li = new ArrayList<String>();
Method[] methods = null;
Class<?> c = null;
try {
c = Class.forName(cname);
methods = c.getDeclaredMethods();
System.out.println("Method count = " + methods.length);
if (methods.length > 0 && methods != null){
for (int a = 0 ; a < methods.length;a++){
li.add(methods[a].toString());
}
}
} catch (ClassNotFoundException ex) {
System.out.println("Class not found");
}
return li;
}
#end if