java - CardLayout - how to change name of component -


is there way change name of panel added panel cardlayout? want use show method without having use name gave panel when added main panel.

jpanel panel = new jpanel(); add(panel, "0"); show(this, "0"); ...              // change name of panel "1" show(this, "1"); // can show panel 

    // original cardpanel1 name "card1"      cardlayout lay = (cardlayout)parentpanel.getlayout();     lay.removelayoutcomponent(cardpanel1);     lay.addlayoutcomponent(cardpanel1, "card4");      // cardpanel1 can shown using "card4" name 

Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -