'Reusing' Controllers in JavaFX -


first off, new world of javafx, might lack basic knowledge, sorry that. also, first time ask question, don't know how formulate it.

what want quite basic: have multiple pages user can switch between pressing next/back. best way code changes made user there when returns page? not want textfields have same contents attributes. note: every page has own controller implements common interface.

i have tried setting pages via loader , using loader.setcontroller() method , handing on controller object got loader.getcontroller() when first creating it, doesn't seem have effect. sorry if answered somewhere, couldn't find it. in advance takes time me!

edit: code change pages in controllerholder class

resourcebundle bundle = fxmlutil.getresourcebundle();  fxmlloader loader = new fxmlloader(); loader.setlocation(main.class.getresource(   fxmlutil.getfxmlpagebyindex(pagenumber) )); loader.setresources(bundle);  initwizardholder.getchildren().setall(   (node) loader.load());  currentcontroller = loader.getcontroller(); 


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -