In Java Swing, how to switch between JPanels when the workflow isn't linear? -


i want create jframe switches between multiple jpanels, has more complex structure linked list cardlayout seems offer. there offers more of directed graph based layout?

here's scenario i'm thinking of:

 ----------------------------  ->  --------------- | select user / new user btn |    | new user form |  ----------------------------  <-  ---------------      |               v  -------- | form 1 |  --------      |      v  --------       -------------- | form 2 |  -> | results page |  --------       -------------- 

as can see isn't linked list, directed graph. there standard way deal scenario?

the cardlayout provides cards, determine card should visible. provides ordered-list style api methods convenience (presumably because designers decided that 1 of more common use cases) don't have use them.

implement flow control in buttons (or in whatever code you're using determine behavior here) , use cardlayout.show() show appropriate card. don't have use first(), last(), previous(), , next() if don't want to.


Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -