CardLayout get the selected card's name

wotan2009 picture wotan2009 · Jun 28, 2011 · Viewed 13.4k times · Source

How can I get the string identifier of the selected panel in card layout.

Answer

Fortega picture Fortega · Jun 28, 2011

The CardLayout does not know what the currently selected panel is. You should keep this in memory yourself, when calling the show() method.