javafx - Java MethodHandle -


@fxml private void handleleftbutton() throws throwable{  methodhandles.lookup lookup = methodhandles.lookup(); methodtype methodtype = methodtype.methodtype(void.class, listiterator.class, text.class); methodhandle leftbuttonclickmethod = lookup.findvirtual(homepresenter.class, "leftbuttonclick", methodtype);  leftbuttonclickmethod.invoke(list, menutitle); 

}

why error?

java.lang.invoke.wrongmethodtypeexception: cannot convert methodhandle(homepresenter,listiterator,text)void (listiterator,text)void

looking @ example in methodhandle - think need pass instance on want call method first argument

leftbuttonclickmethod.invoke(this,list, menutitle); 

but because never worked java.lang.invoke might wrong.


Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -