Tuesday, November 11, 2008

CardPanel

I had the problem of placing a different widgets at the same location with only showing up at a particular time. I was using the cardPanel which is just a layoutContainer with a card layout. The widgets as such cannot be added to the cardPanel but each of them should be placed in a panel and that panel should be added to the cardPanel. cardPanel.add(contentPanel); The user can make the widgets active by using the setActiveItem method in the cardPanel. cardPanel.setActiveItem(contentPanel); Then the widgets should be rendered, using the layout method of the cardPanel, which actually renders all the children of the cardPanel. cardPanel.layout(); It should be understood that the widgets cannot be added to cardPanel as such but they should be placed in another panel

No comments: