try { throw new Exception(); } catch(Exception ex) { name = ex.getStackTrace()[1].getMethodName(); }
Method[] methods = getClass().getDeclaredMethods();
Method m=null;
for(int i=0; i<methods.length; i++) if (methods[i].getName().equals(name)) { m=methods[i]; break; }
final Method method=m;
return new Runner() {
private static final long serialVersionUID = 0;
public void run(Object arg) {
try {
method.setAccessible(true);
method.invoke(VizGUI.this, new Object[]{arg});