Subscribe

RSS Feed (xml)

Powered By

Skin Design:
Free Blogger Skins

Powered by Blogger

Monday, November 19, 2007

CardLayout in java


Used to produce installer or wizard style interface as steps in process, or to select palette. Use JTabbedPanel if user should have control.
crdMgr = new CardLayout(); Sets layout to CardLayout.
crdMgr = new CardLayout(h, v)); Also can specify horizontal and vertical padding.

p.add(cardPanel); Adds next card to panel.

p.add(cardPanel, name); Adds next card to panel. Use String name to select it later.

crdMgr.first(p); Panel p displays the first card in the layout of p.

crdMgr.next(p); Panel p displays the next card in the layout of p.

crdMgr.previous(p); Panel p displays the previous card in the layout of p.

crdMgr.last(p); Panel p displays the last card in the layout of p.

crdMgr.show(p, name); Panel p displays card with String name name in panel p.

No comments:

Post a Comment

Archives