java - Lazy-initialization enabled CardLayout? -


i have bunch of panels put in cardlayout nth panel depends on state changes caused in (n - 1)th panel. since cardlayout, have initialize and add panels beforehand. such makes harder necessary manage state.

does java or third party open source library provide variation of cardlayout initializes constituent panels lazily i.e. initialized before going visible?

edit:

perhaps did not state problem clearly. let me try again.

i need set panels in cardlayout beforehand, not want initialize them until made visible. necessary state changes previous stages transparently propagated next stages.

in current code, have:

cardspanel.add(readmepanel.create(this), readmepanel.id); cardspanel.add(licencepanel.create(this), licencepanel.id); cardspanel.add(installationpathpanel.create(this), installationpathpanel.id); cardspanel.add(   extractionprogresspanel.create(     this,     new normalizedpath(appcontext.getparameter("zipfilepath")),     new normalizedpath(appcontext.getinstallationdirectory().tostring())   ),    extractionprogresspanel.id ); 

here installationpathpanel allows users select different installation directory default one. extractionprogresspanel supposed extract zip file directory. if extractionprogresspanel lazily initialized, user selected path propagated it, without me doing extra.

hope problem clear now.

you can initialize , add panel cardlayout right before calling show method, there no problem.

edit

so on location call cardlayout#show, first add , show

as looks trying create wizard, following article might place start


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -