Home
Email
Butnz!

All About CardLayout

java.awt.CardLayout is an easy layout - you just have one panel and all the components are on top of each other. You have to bring whichever one you want to the front with the show() method in CardLayout. That's great until you want to switch between them, then you have to make some other arrangements, like a whole bunch of buttons. The AWT doesn't provide an easy way to do this, so I made one myself.

The applet is a BorderLayout with a single component which is called a CardPanel. The CardPanel contains two components. At the top is a CardController, which draws the tabs, and at the bottom is a Panel with CardLayout. I wrote CardController and CardPanel. The source code for the applet is trivial.


This page hosted by Get your own Free Home Page.
This page uses Verdana fonts which Windows users can download from Microsoft for free.

Friendless 1