'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
Post a Comment