The CardLayout class manages components so that only one is visible at a time. It treats each component as a "card". Constructors include CardLayout() and CardLayout(int hgap, int vgap). Commonly used methods are next(), previous(), first(), last(), and show() for flipping between cards. An example program demonstrates using CardLayout to flip between JButtons when they are clicked. It sets the layout, adds buttons as cards, and uses action listeners and the next() method to flip on button clicks.